12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/bin/bash
- echo $1
- FILE=${1%.md}
- cat $1 > temp.md
- if [ "${FILE}" != "./index" ]; then
- if [[ $FILE == *index ]]
- then
- DEST=".."
- else
- DEST="index.html"
- fi
- RETURN="<a href='$DEST'>Back to previous index</a>"
- fi
- echo "" >> temp.md
- echo "[License](/license.md)" >> temp.md
- sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*)/.html\1)/g'
- TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2")
- SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart")
- pandoc $TOC $SMART temp.md -s --css /global.css -T Libreboot \
- --template template.html --metadata return="$RETURN"> $FILE.html
|