Skip to content

Extensible templates, fixes, and improved documentation

Choose a tag to compare

@htdebeer htdebeer released this 19 Sep 14:51
· 156 commits to master since this release

Since the last release earlier this year a lot has happened to pandocomatic. Besides a large amount of bug fixes, the template engine has been improved and the manual rewritten!

Futhermore, pandocomatic is compatible with pandoc2.

Comments are welcome.

Highlights

  • Template engine
    • Templates can be extended; a template can extend one or more templates. This allows you to setup a modular set of (re)usable template components. For example, in the template definition below, the my-webpage templates builds on the author template (to mix in my name as author), the today template (to mix in today's date) and the webpage template (with general settings to convert to HTML):

      templates:
           author:
               metadata:
                   author: Huub de Beer
           today:
               preprocessors:
                   -   preprocessors/today.rb
           webpage:
               glob: ['*.md']
               pandoc:
                   to: html
                   toc: true
                   css:
                       - assets/style.css
               postprocessors:
                   - postprocessors/tidy.sh
           my-webpage:
               extends: ['author', 'today', 'webpage']
               pandoc:
                   to: html5
                   bibliography: 'assets/my-bibliography.bib'
      
    • Added the metadata section to template definitions, allowing you to set common metadata such as an author, keywords, language, and so on (see example above)

    • Added the setup and cleanup sections, which are a list of scripts to be run before the conversion process is started and after it has finished. This can be used to setup or clean up the environment needed for a conversion.

  • Using templates
    • A document can use multiple templates. The document will be converted once for each of these templates
    • All template sections can be customized in a document rather than only the pandoc section.
  • Error reporting
    • pandocomatic now exits with a status code <> 0 when something went amiss.
    • warnings during conversion are printed to STDERR rather than ignored
  • Documentation
    • There is a full documentation coverage of pandocomatic's code base
    • The manual has been rewritten to cover all the new features and improvements.