Files
q-tools/reporting/md-color
ville rantanen 5e0afc4d09 markdown tools
2015-06-09 12:28:35 +03:00

33 lines
623 B
Bash
Executable File

#!/bin/bash
function helpexit() {
echo "Colorify a markdown document"
echo "Give filename(s) as the argument"
echo " Depends on highbeam "
exit
}
[[ -z "$1" ]] && helpexit
[[ "$1" = "-h" ]] && helpexit
export HB_RULES='"^\s*\*.*" "$y" \
"^[[:space:]]*[0-9]\+\..*" "$y" \
"^#.*" "$W" \
"^\s\s\s\s[^\*0-9].*" "$c" \
"\`[^[[:space:]]]*[^\`]\+\`" "$c" \
"\[[^]]\+\]([^)]\+)" "$B" \
"\*[^[[:space:]]]*[^\*]\+\*" "$H" \
"_[^[[:space:]]]*[^\_]\+_" "$H" \
"<[^>]\+>" "$K" \
'
# * bullets
# 1. ordered list
# ## Headers
# code block
# code inline
# [links](URL)
# *bold*
# _bold_
# <> tags
cat "$@" | highbeam