ipypublish.filters_pandoc.prepare_labels module¶
a panflute filter to prepare document labelling in markdown files:
Add a
$$reference
key to the Document metadata
Then, for each Image, Math and Table found;
2) Extract labels and attributes to the right of Math or Table captions,
in the form; {#id .class-name a="an attribute"}
If attributes found, remove them from the document and wrap the associated Math/Table in a Span/Div with the attributes and an additional class:
labelled-Math
orlabelled-Table
For all labelled Tables, Math and Images, place in metadata as e.g. meta[“$$references”][label] = {“type”: “Math”, “number”: 1}
For example:
‘$$a=1$$ {#a b=$2$}’
would be converted to this html:
<p>
<span id="a" class="labelled-Math" data-b="2">
<span class="math inline"><em>a</em> = 1</span>
</span>
</p>