Over a million developers have joined DZone.

Generating HTML from Markdown with Pandoc

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

I'm writing more and more things these days that are not code, and my content-managing toolchains are becoming more developed all the time. I've written in reStructuredText, Asciidoc and LaTeX, and today I'm working on an article that eventually wants to be HTML, but I'm creating it in Markdown because it's much easier.

My Swiss Army knife of document formats is a program called pandoc. It's absolutely fabulous, powerful and not too complicated, as long as you don't need to do anything too complicated. It will guess input and output formats from file extensions, or you can be more specific if you need to. Today's command looks like this:

pandoc article.md -o article.html

You won't be surprised to hear that this command takes a file called article.md, which contains my markdown, and outputs a file called article.html containing the HTML. I also use this to convert between all the various text markups and HTML, and also PDF and Office document formats. It's a very comprehensive tool!

 

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}