phyllisstein / Pandown

A powerful, versatile, highly Subliminal Pandoc build wrapper for ST2/3
64 stars 12 forks source link

Filters #24

Open twsh opened 9 years ago

twsh commented 9 years ago

Unless I've missed it, there's no way to use a Pandoc filter with Pandown, like having --filter=foo.py on the command line. I would quite like to be able to.

MFykoopS commented 9 years ago

I see that this issue is quite old but I just found a solution so I thought I'd post it.

I just found out that this is indeed possible (although it's not documented). You can just add a "filter": "foo.py" in the Pandown.sublime-settings (or the project settings file). You can also use a list. I use a the zotxt filter together with citeproc to convert Zotero citations and searched for hours for a solution to use it. Then I saw in the pandownBuildCommand.py file that the build command iterates over everything in the command arguments section and appends it to the pandoc command. My Pandown.sublime-settings file now looks like:

{
    "preprocess_critic": true,
    "pandoc_arguments":
    {
        "command_arguments":
        {
            "csl": "/home/mfykoops/texts/styles/apa",
            "filter":
            [
                "pandoc-zotxt",
                "pandoc-citeproc"
            ],
        }
    }
}

Long story short: The functionality is there but it's undocumented. Maybe an explanation of how the build command just adds anything under command line (and not just the options explained there) could be added to the commentary in the default config?

twsh commented 9 years ago

Thank-you!