I need help finding a terminal-based tool that can convert GitHub-style Markdown documents into HTML format. I’m working with a GitHub wiki that I’ve downloaded to my local machine and want to turn these files into standard HTML pages.
The tricky part is that I need the output to match exactly what GitHub shows. I’m also using code blocks with the triple backtick syntax, so regular Markdown processors won’t work for my needs.
I tried looking at some JavaScript preview tools to see if I could use them with Node.js, but those seem to be outdated now. I also checked out redcarpet but couldn’t find any command line options.
Has anyone found a good solution for this? I’m open to any suggestions that can handle GitHub’s specific Markdown features.
If you’re looking for a robust solution, I recommend trying Pandoc. It excels at converting GitHub-flavored Markdown to HTML, accommodating elements like fenced code blocks with the triple backtick syntax you mentioned. Just install it from your package manager and run the command: pandoc -f gfm -t html input.md -o output.html. The -f gfm option ensures that GitHub-specific features are rendered correctly. I’ve had excellent results with Pandoc for project wikis, as the output is very close to what you see on GitHub. If you’re exploring Node.js alternatives, markdown-it with the command-line interface could work too, but in my experience, Pandoc is more dependable.
grip’s another good choice - it mimics GitHub’s rendering really well. it’s mainly for previewing, but you can save the HTML output too. just pip install grip and run grip your-file.md --export output.html. works great with code fences and other gfm features.