pdtmpl
pdtmpl OPTIONS VERB
pdtmpl is a Pandoc preprocessor intended as a simple platform to test various ideas about how to better support Pandoc generated static websites.
The first use case is to take a JSON or YAML file turning the data into a YAML block that then is sent through Pandoc using the a Pandoc template and any additional Pandoc processing options.
The second use vase is to take a Markdown document, scan it for YAML blogs containing a “form” object then replacing those blocks with an HTML block holding a web form. The goal of the usecase is to see if that improves readability of the original Markdown file also making the aggregated HTML generated from Pandoc easier to manage.
pdtmpl expect a verb to describe the use case be tested. Currently support verbs are
In this example we have a JSON object document called “example.json” and a Pandoc template called “example.tmpl”. A redirect “<” is used to pipe the content of “example.json” into the command line tool pdtmpl.
pdtmpl tmpl example.tmpl < example.json
Render example.json as Markdown document. We need to use Pandoc’s own options of “-s” (stand alone) and “-t” (to tell Pandoc the output format)
pdtmpl tmpl “” -s -t markdown < example.json
Process a “codemeta.json” file with “codemeta-md.tmpl” to produce an about page in Markdown via Pandocs template processing (the “codemeta-md.tmpl” is a Pandoc template marked up to produce Markdown output).
pdtmpl -i codemeta.json -o about.md tmpl
codemeta-md.tmpl
In this example we have a markdown file called “guestbook.md” is processed and then sent through Pandoc to render as HTML.
pdtmpl webform guestbook.md | pandoc -f Markdown -t HTML5 -s \
>guestbook.html