‹›
markdown.extensions.footnotes
¶
Adds footnote handling to Python-Markdown.
See the documentation for details.
‹›
markdown.extensions.footnotes.FootnoteExtension(**kwargs)
¶
Bases: Extension
Footnote Extension.
‹›
markdown.extensions.footnotes.FootnoteExtension.config
instance-attribute
¶
Default configuration options.
Defined Value:
self.config = {
'PLACE_MARKER': [
'///Footnotes Go Here///', 'The text string that marks where the footnotes go'
],
'UNIQUE_IDS': [
False, 'Avoid name collisions across multiple calls to `reset()`.'
],
'BACKLINK_TEXT': [
'↩', "The text string that links from the footnote to the reader's place."
],
'SUPERSCRIPT_TEXT': [
'{}', "The text string that links from the reader's place to the footnote."
],
'BACKLINK_TITLE': [
'Jump back to footnote %d in the text',
'The text string used for the title HTML attribute of the backlink. '
'%d will be replaced by the footnote number.'
],
'SEPARATOR': [
':', 'Footnote separator.'
]
}
‹›
markdown.extensions.footnotes.FootnoteExtension.reset() -> None
¶
Clear footnotes on reset, and prepare for distinct document.
‹›
markdown.extensions.footnotes.FootnoteExtension.unique_ref(reference: str, found: bool = False) -> str
¶
Get a unique reference if there are duplicates.
‹›
markdown.extensions.footnotes.FootnoteExtension.findFootnotesPlaceholder(root: etree.Element) -> tuple[etree.Element, etree.Element, bool] | None
¶
Return ElementTree Element that contains Footnote placeholder.
‹›
markdown.extensions.footnotes.FootnoteExtension.setFootnote(id: str, text: str) -> None
¶
Store a footnote for later retrieval.
‹›
markdown.extensions.footnotes.FootnoteExtension.get_separator() -> str
¶
Get the footnote separator.
‹›
markdown.extensions.footnotes.FootnoteExtension.makeFootnoteId(id: str) -> str
¶
Return footnote link id.
‹›
markdown.extensions.footnotes.FootnoteBlockProcessor(footnotes: FootnoteExtension)
¶
Bases: BlockProcessor
Find all footnote references and store for later use.
‹›
markdown.extensions.footnotes.FootnoteInlineProcessor(pattern: str, footnotes: FootnoteExtension)
¶
‹›
markdown.extensions.footnotes.FootnotePostTreeprocessor(footnotes: FootnoteExtension)
¶
Bases: Treeprocessor
Amend footnote div with duplicates.
‹›
markdown.extensions.footnotes.FootnotePostTreeprocessor.add_duplicates(li: etree.Element, duplicates: int) -> None
¶
Adjust current li
and add the duplicates: fnref2
, fnref3
, etc.
‹›
markdown.extensions.footnotes.FootnotePostTreeprocessor.get_num_duplicates(li: etree.Element) -> int
¶
Get the number of duplicate refs of the footnote.