Initial commit

This commit is contained in:
Alexander Gehrke 2019-09-30 14:49:14 +02:00
commit cefd40b6dc
31 changed files with 1028 additions and 0 deletions

11
bin/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