Created
June 21, 2016 07:52
-
-
Save reasonset/10d1fb30aacfa5643e37740ca185c66d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
# Generate HTML files from Markdown files. | |
# It convert foo/bar.md to foo/bar.html | |
# This needs Pandoc. | |
STYLE_FILE="$HOME/local/repos/markdown-css/build/github/github.css" | |
BODY_CLASS="github" | |
PANDOC_OPTS=(-s --self-contained -t html5 -c $STYLE_FILE --toc) | |
for i in **/*.md | |
do | |
pandoc "$i" $PANDOC_OPTS -o "${i:r}".html && sed -i -e 's/<body>/<body class="'"$BODY_CLASS"'">/' "${i:r}".html | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment