panview 354 B

12345678910111213141516171819202122
  1. #!/bin/bash -e
  2. FILE=$(mktemp)
  3. if [ $# -lt 1 ]; then
  4. INP="-"
  5. else
  6. INP="$1"
  7. shift
  8. fi
  9. if [ x"$1" = x--github ]; then
  10. FMT="markdown_github"
  11. elif [ x"$1" = x--rst ]; then
  12. FMT="rst"
  13. else
  14. FMT="markdown"
  15. fi
  16. echo "format: $FMT; source: $INP; tmp location: $FILE"
  17. pandoc --standalone -f $FMT -i $INP -t html -o $FILE
  18. surf $FILE
  19. rm $FILE