bashopenshiftjekyllpandocopenshift-cartridge

How should I bundle pandoc with my OpenShift application?


I've been running jekyll on OpenShift using https://github.com/openshift-quickstart/jekyll-openshift. I want to be able to rebuild my web site automatically in order to future-date posts and not have to rebuild/reupload in order to publish them. This means that I have a cron job running on OpenShift that rebuilds my jekyll site, adapting the deploy bash script from the OpenShift cartridge I am using. So far, so good.

Now I want to use pandoc in place of kramdown. Now I have a problem. How do I install pandoc as part of my application's deployment to OpenShift?

I've searched the web for an hour or so. I'm getting conflicting reports. Use puppet. Build from source, which starts with "Install the Haskell platform". I don't mind the work, but I'd like some idea which path to go down before doing down them all and tearing my hair out.

So... which path would you choose and which articles can I read to guide me through learning what I need to learn in order to do this?

Thank you.


Solution

  • Pandoc is written in Haskell, so you'll have to build it using cabal or stack. However once built, you can move the binary to your server:

    From Installing Pandoc:

    It is possible to compile pandoc such that the data files pandoc uses are embedded in the binary. (The executables in the binary are built this way.) The resulting binary can be run from any directory and is completely self-contained.

    cabal update
    cabal install hsb2hs
    cabal install --flags="embed_data_files" pandoc pandoc-citeproc