leo.blog();

Pandoc

Pandoc is a markup format conversion utility written in Haskell. It is the swiss army knife of markup formats, it can really convert between almost anything.

Installation

Pandoc provides official statically compiled binaries on their Github repo.

Pandoc Server

When bulk-processing inputs in a script, it can be a little slow to spawn a pandoc subprocess for each document. Instead, you can use the built-in pandoc-server to spawn a persistent server and send each document over.

From my experiments, this works very fast. And the output quality is a lot higher than most Python “HTML to Markdown” or “HTML to plain text” libraries.

This command starts a pandoc server on port 1456.

./pandoc-server -p 1456

Leave a Comment