documents for web and print with markdown and pandoc

Every time I’ve written documentation that is destined for print as well as web, I’ve been struck by how hard it is to get both looking good. And as a lazy programmer, I’ve always resisted keeping 2 versions of a document.

I’ve dabbled with Latex, but it’s always seemed overkill for the kind of documents I have to write. After using github for a while, and getting used to markdown (used for their readmes), I thought it would be great to write all my documents in markdown, and then render them to html and pdf.

Happily, I discovered pandoc, which can convert many different types of markup, including markdown. This means I can now write documents that look like this:

# Reaction timer

One of the simplest programs and circuits we can make with an LED and a button is a reaction timer.

## What will be learnt

In this lesson, students will learn how to:

* create a basic circuit
* control input and output with the raspberry pi
* store and retrieve data using variables

And they get converted to great looking HTML, and paginated PDFs with a table of contents. It even does code syntax highlighting! See the pandoc demos page for examples on how to do it.


Leave a Reply

Your email address will not be published. Required fields are marked *