md-viewer 441 B

1234567891011121314151617
  1. #!/bin/sh
  2. # Simple Markdown Viewer for example for vim.
  3. # Uses the suckless browser surf and pandoc for md->html convertion
  4. # Uses the Github-Markdown css
  5. if [ ${#1} -le 0 ]; then
  6. exit 1
  7. fi
  8. mdfile=$1
  9. #pandoc --template github $mdfile -o /tmp/out.html > /dev/null
  10. pandoc --template github $mdfile -o /tmp/out.html > /tmp/wtf
  11. if [ $? -eq 0 ] ; then
  12. # start as completly new process
  13. nohup surf /tmp/out.html >&2 2>/dev/null &
  14. fi