Closed
Description
I am looking for a way to get pandoc to dump out metadata along with a document fragment. This should behave as follows:
- There should be some unambiguous syntactic mechanism to distinguish the metadata from the document fragment. I don't care what that is.
- All metadata should be dumped, not just what is meaningful to pandoc itself or a template.
- It should be dumped out as JSON, faithfully reproducing whatever data structure was read in (for instance, YAML lists should be preserved)
- Strings should be rendered using the same markup as the document fragment.
An example would probably help: given
---
authors: [joe bloggs, fred mbogo]
title: This title contains *emphasis* and $m$-ath
...
This is the body of the document
pandoc -t html5+metadata --mathml
should produce something like
<!-- metadata:
{"authors":["joe bloggs","fred mbogo"],"title":"This title contains <em>emphasis</em> and <math><mrow><mi>m</mi></mrow></math>-ath"}
:metadata -->
<p>This is the body of the document</p>
It's quite possible that there's already a way to do something like this and I just can't find it, in which case I would appreciate a pointer.
A way to dump only the metadata, but still applying a rendering, would also be useful.