Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Markdown utilities (requires `brew install pandoc`)
- function mdless () {
- local mdfile=$1
- if [ -z ${mdfile:+x} ]; then mdfile="README.md"; fi
- case $mdfile in
- -h | --help)
- print "mdless usage: 'mdless myfile.md' or 'mdless' (defaults to README.md)"
- ;;
- *)
- mdcat $mdfile | less
- ;;
- esac
- }
- function mdcat () {
- local mdfile=$1
- if [ -z ${mdfile:+x} ]; then mdfile="README.md"; fi
- pandoc -s -f markdown -t man $mdfile | groff -T utf8 -man
- }
Add Comment
Please, Sign In to add comment