How do I build my pandoc document/ run pandoc build script on current document?


#1

How I would I add a “build” command for pandoc markdown?

eg. in BBEdit I have this bash script in the scripts menu. It grabs the current document and path, parses a pdf output title, and passes that as the arguments to pandoc:

#!/bin/bash
PATH=$PATH:/usr/texbin:/usr/local/bin

cd "$(dirname "$BB_DOC_PATH")"
pandoc -o "${BB_DOC_PATH%%.*}".pdf "$BB_DOC_PATH"

In Sublime Text 3, this is even easier, I can just hit build.

What would be the equivalent of this in Atom?

I’ve tried installing various build/ script packages, but none of them seem to do anything.


#2

There’s this really great topic here all about Pandoc and the various packages for making people’s lives easier using it:

I’d be surprised if you didn’t find something that would help in there.


#3

That’s just the thing, although there are lots of packages for previewing pandoc, none of them actually build the document (I read that thread). I thought it was worth starting a separate thread because, as I see it, this isn’t necessarily an issue specific to pandoc. I’d’ve thought “Run script x on the active file” would be a fairly common thing that people do, and that there’s probably some obvious way of doing it that I just haven’t found yet.

eg, the most-downloaded script running package script: I select “configure script”, enter command “pandoc”, arguments “-o docx”, hit run, it says Command not configured for Pandoc Markdown!

(this is when launching Atom from the terminal)


#4

Half of my reasoning for linking the other topic was in case you missed it. The other half was to help future searchers if they find your topic first but were really looking for the stuff in the other topic :laughing:

There are plenty of script or build packages because, as you say, this is a common request. Have you tried filing a bug on the script package to see why it is giving the error you see?


#5

I added pandoc support to the script package: https://atom.io/packages/script

details here: