Guest User

Untitled

a guest
Feb 23rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. # Markdown utilities (requires `brew install pandoc`)
  2. function mdless () {
  3. local mdfile=$1
  4. if [ -z ${mdfile:+x} ]; then mdfile="README.md"; fi
  5. case $mdfile in
  6. -h | --help)
  7. print "mdless usage: 'mdless myfile.md' or 'mdless' (defaults to README.md)"
  8. ;;
  9. *)
  10. mdcat $mdfile | less
  11. ;;
  12. esac
  13. }
  14.  
  15. function mdcat () {
  16. local mdfile=$1
  17. if [ -z ${mdfile:+x} ]; then mdfile="README.md"; fi
  18. pandoc -s -f markdown -t man $mdfile | groff -T utf8 -man
  19. }
Add Comment
Please, Sign In to add comment