ipypublish.filters_pandoc.prepare_cites module

a panflute filter to find citations in markdown, with attributes and prefixes,

  • extract the attributes, classes and prefix

  • wrap the cite with a Span with class ‘attribute-Cite’,

  • add the classes, attributes and prefix to the Span, and

  • remove the attribute string and prefix

For example:

` +@label {}.class-name a=1} xyz *@label2* @label3{ .b} `

would be converted to this html:

`html <p> <span class="class-name attribute-Cite" data-a="1" data-prefix="+"> <span class="citation" data-cites="label">@label</span> </span> xyz <em><span class="citation" data-cites="label2">@label2</span></em> <span class="b attribute-Cite" data-prefix="{"> <span class="citation" data-cites="label3">@label3</span> </span> </p> `

Optionally, this can be turned off by adding to the Document metadata

meta[“ipub”][“pandoc”][“at_notation”] = False

ipypublish.filters_pandoc.prepare_cites.finalize(doc)[source]
ipypublish.filters_pandoc.prepare_cites.main(doc=None, extract_formats=True)[source]

if extract_formats then convert citations defined in latex, rst or html formats to special Span elements

ipypublish.filters_pandoc.prepare_cites.prepare(doc)[source]
ipypublish.filters_pandoc.prepare_cites.process_citations(element, doc)[source]