ipypublish.filters_pandoc.format_label_elements module

a panflute filter to format elements types that may contain reference labels, i.e. Math, Image and Table.

The ipypublish.filters_pandoc.prepare_labels filter should be run first to access the functionality below:

If the parent of the element is a Span (or Div for Table), with a class labelled-Math/labelled-Image/labelled-Table, then the label of the element will be span.identifier, and the attributes and classes from this Span will be used to inform the format.

Additionally, for HTML, if a ‘$$references’ key is available in the metadata, this will be used to add a suffix to the element captions, with the number of the element.

Finally, if main() is called with strip_spans = True (the default), The Span/Div elements with classes labelled-Math/labelled-Image/labelled-Table will be stripped from the document

ipypublish.filters_pandoc.format_label_elements.format_image(image, doc)[source]

originally adapted from: pandoc-fignos

ipypublish.filters_pandoc.format_label_elements.format_math(math, doc)[source]

originally adapted from: pandoc-eqnos

ipypublish.filters_pandoc.format_label_elements.format_table(table, doc)[source]

originally adapted from: pandoc-tablenos

ipypublish.filters_pandoc.format_label_elements.main(doc=None, strip_spans=True)[source]
ipypublish.filters_pandoc.format_label_elements.strip_labelled_spans(element, doc)[source]