ipypublish.filters_pandoc.prepare_labels module

a panflute filter to prepare document labelling in markdown files:

  1. 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"}

  1. 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 or labelled-Table

  2. 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>
ipypublish.filters_pandoc.prepare_labels.finalize(doc)[source]
ipypublish.filters_pandoc.prepare_labels.main(doc=None)[source]
ipypublish.filters_pandoc.prepare_labels.prepare(doc)[source]
ipypublish.filters_pandoc.prepare_labels.resolve_equations_images(element, doc)[source]
ipypublish.filters_pandoc.prepare_labels.resolve_tables(element, doc)[source]