Can I set command line arguments using the YAML metadata

前端 未结 2 1033
有刺的猬
有刺的猬 2020-12-18 08:00

Pandoc supports a YAML metadata block in markdown documents. This can set the title and author, etc. It can also manipulate the appearance of the PDF output by changing the

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 08:28

    Have a look at panzer (GitHub repository).

    This was recently announced and released by Mark Sprevak -- a piece of software, that adds the notion of 'styles' to Pandoc.

    It's basically a wrapper around Pandoc. It exploits the concept of YAML metadata blocks to the maximum.

    The 'styles' provide a way to set all options for a Pandoc document conversion process with one line ("I want this document be an article/CV/notes/letter.").

    You can regard this as more general abstraction than Pandoc templates. Styles are combinations of...

    • ...Pandoc command line options,
    • ...metadata settings,
    • ...templates,
    • ...instructions to run filters, and
    • ...instructions to run pre/postprocessors.

    These settings can be customized on a per output type as well as a per document basis. Styles can be...

    • ...combined and
    • ...can bear inheritance relations to each other.

    panzer styles simplify Makefiles: they bundle everything concerning the look of a document in one place -- the YAML metadata (a block in the Markdown file, or a separate file).

    You just add one line of metadata (style: ...) to your document, and it will be treated as a letter/article/CV/notebook or whatever.

提交回复
热议问题