Module

plugins.footnotes

Footnotes plugin for Patitas.

Adds support for footnote references and definitions.

Usage:

>>> md = create_markdown(plugins=["footnotes"])
>>> md("Text with footnote[^1].
'<p>Text with footnote<sup><a href="#fn-1">1</a></sup>.</p>...'

Syntax:

Reference: [^identifier] Definition: [^identifier]: Content here

Multi-line definitions:

First paragraph of footnote.

Second paragraph with indent.

Features:

  • Numeric or named identifiers: [^1], [^note]
  • Footnotes collected and rendered at end
  • Back-references from footnote to text
  • Multi-paragraph footnotes with indentation

Thread Safety:

This plugin is stateless and thread-safe.

  1. Footnote content.")

Classes

FootnotesPlugin 4
Plugin adding [^1] footnote support. Footnotes are: 1. Parsed as inline references [^id] 2. Define…

Plugin adding [^1] footnote support.

Footnotes are:

  1. Parsed as inline references [^id]
  2. Defined as block elements [^id]: content
  3. Rendered as a footnotes section at document end

Methods

name 0 str
property
def name(self) -> str
Returns
str
extend_lexer 1
Enable footnote detection in lexer.
def extend_lexer(self, lexer_class: type[Lexer]) -> None
Parameters
Name Type Description
lexer_class
extend_parser 1
Enable footnote parsing.
def extend_parser(self, parser_class: type[Parser]) -> None
Parameters
Name Type Description
parser_class
extend_renderer 1
Enable footnote section rendering.
def extend_renderer(self, renderer_class: type[HtmlRenderer]) -> None
Parameters
Name Type Description
renderer_class