Creating Web Pages from Markdown

Pandoc is one of the quickest ways to create a web page out of Markdown — even better when using Pandoc’s own Markdown flavor, which is used to create textbooks and other substantial texts. The process is actually pretty easy.

But First …

Step by Step

Open VSCode and open a terminal.

Navigate from the terminal into the directory containing your Markdown document.

Reset VSCode to this location.

code -r .

Open your Markdown document in VSCode.

Notice the preview icon in the upper right.

Click the preview icon to check it. The preview can be customized to give you a reasonable good view of what the document will look like when rendered with pandoc. You can also consider getting the Markdown Preview Enhanced extension.

Get it looking like you like. Then you can build it from the terminal.

pandoc -s -o YOURFILE.html

💬 Even though there are extensions to do this by clicking on something in VSCode it is better to learn the pandoc command options for doing it from the terminal, which you can later automate. You can look for other options with man pandoc from the command line.