I threw together a gh extension, gh-render-markdown, to quickly render Markdown using the GitHub API.

Install it with gh extension install itspriddle/gh-render-markdown.

Usage:

gh render-markdown <files>
gh render-markdown < file
gh render-markdown <<< '# markdown'
echo '# markdown' | gh render-markdown
gh render-markdown
# markdown from stdin
^D