Skip to content

Commit

Permalink
Docs: add links to programs
Browse files Browse the repository at this point in the history
Resolves #71

Co-authored-by: ld991 <[email protected]>
  • Loading branch information
NikitaIvanovV and ld991 committed Aug 26, 2023
1 parent 95bfa37 commit bfed248
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 29 deletions.
58 changes: 41 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-->

Expand Down
37 changes: 35 additions & 2 deletions deptable/list.awk
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,49 @@ 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])

for (t in types)
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]
}
}
19 changes: 15 additions & 4 deletions deptable/markdown.sed
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down
26 changes: 20 additions & 6 deletions deptable/roff.sed
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bfed248

Please sign in to comment.