Restructuring the repo

This commit is contained in:
Alexander Gehrke 2020-04-02 10:38:36 +02:00
parent 21e3cf65e6
commit 3d67598c27
45 changed files with 368 additions and 77 deletions

11
misc/mdcat Executable file
View file

@ -0,0 +1,11 @@
#!/bin/zsh
MDCAT=/usr/bin/mdcat
encoding=$(file -i "$1" | sed "s/.*charset=\(.*\)$/\1/")
if ! iconv -f $encoding <<<"" &> /dev/null; then
cat "$1"
elif [[ $encoding != 'utf-8' ]]; then
iconv -f $encoding -t 'utf-8' < "$1" | $MDCAT /dev/stdin
else
$MDCAT $1
fi