Module

markdown.filters

Template filter registration for Markdown rendering.

Provides a one-liner to register amarkdownfilter on a chirp App so that templates can use{{ content | markdown }}.

Functions

register_markdown_filter 4 MarkdownRenderer
Register a ``markdown`` template filter on the app. Creates a ``MarkdownRender…
def register_markdown_filter(app: App, *, plugins: list[str] | None = None, highlight: bool = True, filter_name: str = 'markdown') -> MarkdownRenderer

Register amarkdowntemplate filter on the app.

Creates aMarkdownRenderer and registers its rendermethod as a kida template filter. Returns the renderer so callers can also use it directly (e.g., in route handlers).

Usage::

from chirp.markdown import register_markdown_filter

app = App()
md = register_markdown_filter(app)

# In templates: {{ content | markdown }}
# In code:      html = md.render("# Hello")
Parameters
Name Type Description
app App

The chirp application to register the filter on.

plugins list[str] | None

Patitas plugins to enable (default: all).

Default:None
highlight bool

Enable syntax highlighting for fenced code blocks (default: True).

Default:True
filter_name str

Template filter name (default:"markdown").

Default:'markdown'
Returns
MarkdownRenderer