Creating a Pandoc engine

Migrating from Nanoc to Middleman, I got a little lost in the doc.

I need to filter my sources through Pandoc and Haml, depending on the file extension. “Filtering” is the word for it in Nanoc. I guess “engine” is the corresponding concept in Middleman.

Do I need to create my own extension for this? Where does the code have to be hooked in, and how do I make it dependent on the file extension?

What I got is that I have to set the markdown engine to Pandoc:

set :markdown_engine, :pandoc

But the Pandoc filter does not exist, so I have to create it myself. Also, this does not take care of Haml sources, right?

Middleman already handles Haml, so no problem there.

For Pandoc, you’d just need to find/create a Tilt plugin for Pandoc. I bet there’s one out there.

1 Like