Twenty Years of Pandoc

fiddlosopher1 pts0 comments

Pandoc - twenty-years-of-pandoc

Twenty Years of Pandoc

On August 3, 2006, I uploaded the first version of pandoc to my<br>website, releasing it under the free GPL license. Pandoc 0.1<br>consisted of about 3000 lines of Haskell code, with no<br>dependencies aside from GHC’s standard library. It could convert<br>Markdown, reStructuredText, HTML, and LaTeX documents into any of<br>these formats, plus RTF or S5. I had no idea at the time that this<br>would just be the first of over two hundred releases over the next<br>twenty years; that the project would become the most<br>popular program written in Haskell; that I would spend<br>countless hours on bug-fixes, improvement, and project management;<br>that I would collaborate with programmers in many other countries;<br>that pandoc would come to support over fifty document formats;<br>that it would allow automatic generation of citations and<br>bibliographies; that it would become integrated into academic<br>writing tools like Quarto and Jupyter Notebook; that it would be<br>installed on millions of computers around the world.

How did this happen? I want to take advantage of pandoc’s<br>birthday to tell the story of the project, as best I can remember<br>it.

John MacFarlane

August 2, 2026

Prehistory

People often ask: Why is pandoc written in Haskell? There could<br>have been good answers to this question: Haskell is a very good<br>language for writing this kind of application. But in fact, I<br>didn’t decide to write a document converter, then decide to use<br>Haskell for it. I decided to use Haskell, and then decided to<br>write a document converter in it.

I had heard about Haskell from the blog of a philosophical<br>logician friend, Greg<br>Restall. Of an introductory book on Haskell, he said: “I’m<br>glad that this wasn’t the textbook in my introductory computer<br>science course, long ago in 1986. If it were, I may have fallen in<br>love with computing and never become a philosopher” (consequently.org).

Intrigued by this (and not heeding Restall’s warning about the<br>potential effects on my future philosophical productivity), I read<br>A Gentle<br>Introduction to Haskell to get a basic understanding of<br>the language. But the only way to really learn a programming<br>language is to write something in it. I saw that Haskell was good<br>for writing parsers and compilers, and it came with a really nice<br>parser combinator library (parsec), so I decided to write a<br>Markdown parser.

At that time, there were implementations of Markdown in Perl,<br>Python, Ruby, and PHP; they all transformed Markdown directly to<br>HTML through a sequence of regex<br>transformations. Pandoc took a different approach. It parsed the<br>Markdown using parser combinators and produced a real abstract<br>syntax tree (AST), which it could then render to HTML or<br>another format. This was a more reliable architecture (avoiding<br>many quirks of the regex versions). It was also a more extensible<br>one: by writing N parsers (“readers”) and M<br>renderers (“writers”), one could support N × M<br>conversions. Soon I added a reader for reStructuredText, because I<br>kept a lot of my lecture notes and handouts in that format. And I<br>added a writer for LaTeX, because I wanted to be able to produce<br>PDFs. Then I added a writer for Markdown, so I could start to<br>convert my reStructuredText notes to Markdown. And from there the<br>project just snowballed.

Thus, a project that started out as nothing more than the<br>product of procrastination was nurtured by the joy of writing in<br>Haskell and by its increasing usefulness for my own academic<br>work.

First releases (2006–8)

In August 3, 2006, I decided to make the source code available<br>on my website. By now pandoc supported HTML, LaTeX, RST, and<br>Markdown as input and output formats, and RTF as an output format;<br>also PDF via LaTeX.

The first release

I made no attempts to advertise the project, other than<br>emailing two friends. This was before social media (which I’ve<br>never used anyway), before GitHub, and before Hackage, the Haskell<br>package repository. But apparently some people stumbled across it<br>on my website and started using it. In October I was contacted by<br>a Turkish developer, Recai Oktaş, who was trying to get certified<br>as a Debian developer and wanted to package pandoc for Debian<br>linux. So I worked with him to do that. This was a great learning<br>experience for me and it greatly increased the visibility of the<br>project.

During 2007, I continued to improve pandoc, largely guided by<br>my own needs. Version 0.3 added the DocBook writer and the<br>now-standard syntax for footnotes in Markdown. Version 0.4 added<br>support for Markdown tables, definition lists, super/subscript,<br>strikeout, and enhanced ordered lists, as well as writers for<br>groff man pages and ConTeXt. This was the first release to go on<br>the Hackage Haskell<br>package repository, which was started in 2007. The Hackage archive<br>and the new cabal-install tool, which automatically<br>resolved and fetched dependencies, opened up the possibility of<br>depending on external packages.

Pandoc 1 (2008–17)

Pandoc 1.0 was released in...

pandoc haskell markdown project first writing

Related Articles