Functions
register_markdown_filter
4
MarkdownRenderer
▼
Register a ``markdown`` template filter on the app.
Creates a ``MarkdownRender…
register_markdown_filter
4
MarkdownRenderer
▼
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'
|
Returns
MarkdownRenderer