publish.sh 609 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. echo $1
  3. FILE=${1%.md}
  4. cat $1 > temp.md
  5. # add footer
  6. echo '' >> temp.md
  7. if [ "${FILE}" != "./index" ]; then
  8. echo -ne '[Back to home](/index.html) -- ' >> temp.md
  9. fi
  10. echo "[License](license.md)" >> temp.md
  11. # change out .md -> .html
  12. sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*)/.html\1)/g'
  13. # work around issue #2872
  14. TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2")
  15. # work around heterogenous pandoc versions
  16. SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart")
  17. # chuck through pandoc
  18. pandoc $TOC $SMART temp.md -s --css /global.css -T Libreboot > $FILE.html