mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2025-06-20 01:48:05 +02:00
Docs: add links to programs
Resolves #71 Co-authored-by: ld991 <140622991+ld991@users.noreply.github.com>
This commit is contained in:
parent
95bfa3720b
commit
bfed2488ad
58
README.md
58
README.md
@ -43,23 +43,47 @@ For example, you only need either `elinks`, `lynx` or
|
||||
<!--TABLESTART-->
|
||||
| File types | Programs |
|
||||
| ---- | ---- |
|
||||
| any | `exiftool` `cat` |
|
||||
| archive | `atool` |
|
||||
| audio | `ffmpegthumbnailer` `ffmpeg` |
|
||||
| diff | `colordiff` `delta` `diff-so-fancy` |
|
||||
| directory | `ls` |
|
||||
| font | `fontimage` |
|
||||
| gpg-encrypted | `gpg` |
|
||||
| html | `elinks` `lynx` `w3m` |
|
||||
| image | `ueberzug` `chafa` |
|
||||
| json | `jq` |
|
||||
| markdown | `glow` `mdcat` |
|
||||
| office | `libreoffice` |
|
||||
| pdf | `pdftoppm` |
|
||||
| svg | `convert` |
|
||||
| text | `bat` `cat` `highlight` `source-highlight` |
|
||||
| torrent | `transmission-show` |
|
||||
| video | `ffmpegthumbnailer` |
|
||||
| any | [exiftool][exiftool] cat |
|
||||
| archive | [atool][atool] |
|
||||
| audio | [ffmpegthumbnailer][ffmpegthumbnailer] [ffmpeg][ffmpeg] |
|
||||
| diff | [colordiff][colordiff] [delta][delta] [diff-so-fancy][diff-so-fancy] |
|
||||
| directory | ls |
|
||||
| font | fontimage |
|
||||
| gpg-encrypted | [gpg][gpg] |
|
||||
| html | [elinks][elinks] [lynx][lynx] [w3m][w3m] |
|
||||
| image | [ueberzug][ueberzug] [chafa][chafa] |
|
||||
| json | [jq][jq] |
|
||||
| markdown | [glow][glow] [mdcat][mdcat] |
|
||||
| office | [libreoffice][libreoffice] |
|
||||
| pdf | pdftoppm |
|
||||
| svg | convert |
|
||||
| text | bat cat [highlight][highlight] [source-highlight][source-highlight] |
|
||||
| torrent | transmission-show |
|
||||
| video | [ffmpegthumbnailer][ffmpegthumbnailer] |
|
||||
|
||||
[ffmpegthumbnailer]: https://github.com/dirkvdb/ffmpegthumbnailer
|
||||
[w3m]: https://w3m.sourceforge.net/
|
||||
[elinks]: http://elinks.cz/
|
||||
[fontforge]: https://fontforge.org
|
||||
[exiftool]: https://github.com/exiftool/exiftool
|
||||
[highlight]: https://gitlab.com/saalen/highlight
|
||||
[chafa]: https://github.com/hpjansson/chafa
|
||||
[gpg]: https://www.gnupg.org/
|
||||
[transmission]: https://transmissionbt.com/
|
||||
[delta]: https://github.com/dandavison/delta
|
||||
[colordiff]: https://www.colordiff.org/
|
||||
[source-highlight]: https://www.gnu.org/software/src-highlite/
|
||||
[ueberzug]: https://github.com/seebye/ueberzug
|
||||
[mdcat]: https://github.com/swsnr/mdcat
|
||||
[glow]: https://github.com/charmbracelet/glow
|
||||
[atool]: https://www.nongnu.org/atool/
|
||||
[lynx]: https://github.com/jpanther/lynx
|
||||
[libreoffice]: https://www.libreoffice.org/
|
||||
[diff-so-fancy]: https://github.com/so-fancy/diff-so-fancy
|
||||
[imagemagick]: https://imagemagick.org/
|
||||
[poppler]: https://poppler.freedesktop.org/
|
||||
[jq]: https://github.com/jqlang/jq
|
||||
[ffmpeg]: https://ffmpeg.org/
|
||||
|
||||
<!--TABLEEND-->
|
||||
|
||||
|
@ -29,11 +29,36 @@ function process_file(file, i, line, arr, t, p, p_len) {
|
||||
|
||||
t = arr[1]
|
||||
p_len = split(arr[2], p, /\s+/)
|
||||
for (i = 1; i <= p_len; i++)
|
||||
types[t][types_len[t]++] = p[i]
|
||||
for (i = 1; i <= p_len; i++) {
|
||||
types[t][types_len[t]++] = LINKS[p[i]] ? sprintf("[%s][%s]", p[i], p[i]) : p[i]
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
LINKS["exiftool"] = "https://github.com/exiftool/exiftool"
|
||||
LINKS["atool"] = "https://www.nongnu.org/atool/"
|
||||
LINKS["ffmpegthumbnailer"] = "https://github.com/dirkvdb/ffmpegthumbnailer"
|
||||
LINKS["ffmpeg"] = "https://ffmpeg.org/"
|
||||
LINKS["colordiff"] = "https://www.colordiff.org/"
|
||||
LINKS["delta"] = "https://github.com/dandavison/delta"
|
||||
LINKS["diff-so-fancy"] = "https://github.com/so-fancy/diff-so-fancy"
|
||||
LINKS["fontforge"] = "https://fontforge.org"
|
||||
LINKS["gpg"] = "https://www.gnupg.org/"
|
||||
LINKS["libreoffice"] = "https://www.libreoffice.org/"
|
||||
LINKS["elinks"] = "http://elinks.cz/"
|
||||
LINKS["lynx"] = "https://github.com/jpanther/lynx"
|
||||
LINKS["w3m"] = "https://w3m.sourceforge.net/"
|
||||
LINKS["ueberzug"] = "https://github.com/seebye/ueberzug"
|
||||
LINKS["chafa"] = "https://github.com/hpjansson/chafa"
|
||||
LINKS["jq"] = "https://github.com/jqlang/jq"
|
||||
LINKS["glow"] = "https://github.com/charmbracelet/glow"
|
||||
LINKS["mdcat"] = "https://github.com/swsnr/mdcat"
|
||||
LINKS["poppler"] = "https://poppler.freedesktop.org/"
|
||||
LINKS["imagemagick"] = "https://imagemagick.org/"
|
||||
LINKS["highlight"] = "https://gitlab.com/saalen/highlight"
|
||||
LINKS["source-highlight"] = "https://www.gnu.org/software/src-highlite/"
|
||||
LINKS["transmission"] = "https://transmissionbt.com/"
|
||||
|
||||
for (i = 1; i < ARGC; i++)
|
||||
process_file(ARGV[i])
|
||||
|
||||
@ -41,4 +66,12 @@ BEGIN {
|
||||
s = s sprintf("%s\t%s\n", t, join(types[t], " "))
|
||||
|
||||
printf "%s", s | "sort"
|
||||
close("sort")
|
||||
|
||||
print ""
|
||||
for (k in LINKS) {
|
||||
if (!LINKS[k])
|
||||
continue
|
||||
printf ">\t%s\t%s\n", k, LINKS[k]
|
||||
}
|
||||
}
|
||||
|
@ -5,11 +5,22 @@
|
||||
| File types | Programs |\
|
||||
| ---- | ---- |
|
||||
|
||||
# Format links
|
||||
/^>/ {
|
||||
s/>\t/[/
|
||||
s/\t/]: /
|
||||
be
|
||||
}
|
||||
|
||||
# Format rows
|
||||
s/ /` `/g
|
||||
s/\t/ | `/
|
||||
s/^/| /
|
||||
s/$/` |/
|
||||
/^$/! {
|
||||
s/ / /g
|
||||
s/\t/ | /
|
||||
s/^/| /
|
||||
s/$/ |/
|
||||
}
|
||||
|
||||
:e
|
||||
|
||||
# Add a newline at the end
|
||||
$a\
|
||||
|
@ -8,14 +8,28 @@ lb lb\
|
||||
l li .\
|
||||
File type\tPrograms
|
||||
|
||||
# Substitute '-' with '\-'
|
||||
:a
|
||||
s/\(\t.*[^\\]\)-/\1\\-/
|
||||
ta
|
||||
|
||||
# Format rows
|
||||
s/\t/&T{\n/; s/$/\nT}/
|
||||
/^$/! {
|
||||
# Remove links
|
||||
:a
|
||||
s/\[\(\S*\)\]\[\S*\]/\1/
|
||||
ta
|
||||
|
||||
# Substitute '-' with '\-'
|
||||
:b
|
||||
s/\(\t.*[^\\]\)-/\1\\-/
|
||||
tb
|
||||
|
||||
# Add data block to enable line wrapping
|
||||
s/\t/&T{\n/; s/$/\nT}/
|
||||
}
|
||||
|
||||
# Add footer
|
||||
$a\
|
||||
.TE
|
||||
|
||||
# Delete links
|
||||
/^>/d
|
||||
|
||||
# Delete empty lines
|
||||
/^$/d
|
||||
|
Loading…
x
Reference in New Issue
Block a user