Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.