Real helpful, Pandoc…

Pandoc is an open source markdown conversion tool. It can convert between many formats, such as LaTeX, HTML, Markdown, and many others. The project I’ve been working on recently has a book written in Literate Haskell/LaTeX, and uses Pandoc to convert this to PDF. For the most part, Pandoc does this swimmingly.

Unfortunately, as is often the case with open source, things can be a bit rough around the edges. I intend to help proofread the book and provide feedback. To this end, I got the source for the book and, after installing LaTeX, I tried to build the book:

$ make pandoc: Error running filter [source_dir]/.hs fd:4: hPutBuf: resource vanished (Broken pipe) Makefile:60: recipe for target 'pdf' failed make: *** [pdf] Error 83

…really helpful output occurred. Luckily, it seems that I’m not the only person that this has ever happened to, a quick google search turns up this issue opened against Write You A Haskell. After reading the thread, I tried:

$ cabal exec sh $ ghc --make .hs

…and sure enough, there was a problem with the source file that was preventing it from compiling! I fixed the bug, and re-ran make and everything was fine.

So, preserved here for posterity is a potential solution to this issue; if Pandoc gives you this error, make sure there is nothing wrong with your source file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: