I\'m wondering if there is a command line utility for taking a GitHub flavored Markdown file and rendering it to HTML.
I\'m using a GitHub wiki to create website con
Building on this comment I wrote a one-liner to hit the Github Markdown API using curl and jq.
Paste this bash function onto the command line or into your ~/.bash_profile:
mdsee(){
HTMLFILE="$(mktemp -u).html"
cat "$1" | \
jq --slurp --raw-input '{"text": "\(.)", "mode": "markdown"}' | \
curl -s --data @- https://api.github.com/markdown > "$HTMLFILE"
echo $HTMLFILE
open "$HTMLFILE"
}
And then to see the rendered HTML in-browser run:
mdsee readme.md
Replace open "$HTMLFILE" with lynx "$HTMLFILE" if you need a pure terminal solution.