Config Options for Pandoc

Continuing the discussion from Hugo --filter script.sh ? running the markdown files through a filter before processing:

How difficult would be to enable these two config options for pandoc? It seems straightforward.

Just doing this for pandoc would be really valuable, but it is easy to see how it could be extend like this:

parsers:
   my-custom-type:
     extensions: 
       - ext1
       - ext2
    executable: ./path-to-executable
    options:
      - option1
      - option2
    output-format: markdown or html

Something like that would provide way of solving a large number of functionality requests. For example, with this set up, these are some use cases:

  1. Use pandoc as a “docx” parser, and in fact we could set it up so that a mardown file is generated for hugo as an intermediary step.

  2. Use pandoc as a “tex” parser that converts a latex file into markdown, which is then parsed by goldmark, or just straight into HTML.

  3. Use pandoc and cite-proc on source files to add references using a csl file, keyed to Zotero, which could either go straight to HTML or produce an intermediary markdown.

  4. Generate PDF versions of all markdown files, but only if the corresponding PDF doesn’t already exist, and the markdown file is passed back to hugo for standard processing.

That being said, just getting one or two of the config-options up running for pandoc would be really a game changer for what I am doing.

The work around I’m building out now is doing a lot of preprocessing before the markdown actually gets to the content folder, and that does not seem ideal.