How to convert GitHub markdown to a standalone HTML file

Kei Sugiyasu
Sep 13, 2021

Abstract

If you want to share your GitHub README.md with someone who can’t see (or don’t want to see) your site, you might have to export your markdown to the file which can be seen offline.

In this post, I mention how to export GitHub markdown into a standalone HTML file.

Pandoc is a great tool!

You can do it with pandoc!

Following is the sample code using their official docker image.

docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/core --css=readme.css --metadata title="README" -s --self-contained README.md -o README.html

I use readme.css to make the output HTML file looking more GitHub liked.

--

--