Classes
PatitasPlugin
1
▼
Protocol for Patitas plugins.
Plugins are lightweight markers that enable features in Patitas.
The…
PatitasPlugin
1
▼
Protocol for Patitas plugins.
Plugins are lightweight markers that enable features in Patitas. The actual parsing behavior is controlled by ParseConfig via ContextVars.
To enable a plugin, pass its name to Markdown(plugins=[...]). The Markdown class reads the plugin names and sets the appropriate ParseConfig flags.
Thread Safety:
Plugins must be stateless. All state should be in AST nodes.
Methods
name
0
str
▼
Plugin identifier.
property
name
0
str
▼
def name(self) -> str
Returns
str
Functions
get_plugin
1
PatitasPlugin
▼
Get a plugin instance by name.
get_plugin
1
PatitasPlugin
▼
def get_plugin(name: str) -> PatitasPlugin
Parameters
| Name | Type | Description |
|---|---|---|
name |
str |
Plugin name (e.g., "table", "strikethrough") |
Returns
PatitasPlugin
apply_plugins
4
None
▼
Apply plugins to parser components.
Note: This function is deprecated. Plugin …
apply_plugins
4
None
▼
def apply_plugins(plugins: list[str], lexer_class: type[Lexer], parser_class: type[Parser], renderer_class: type[HtmlRenderer]) -> None
Apply plugins to parser components.
Note: This function is deprecated. Plugin configuration is now handled by the Markdown class via ParseConfig and ContextVars. This function is kept for backward compatibility but no longer does anything.
Parameters
| Name | Type | Description |
|---|---|---|
plugins |
list[str] |
List of plugin names to apply |
lexer_class |
type[Lexer] |
Lexer class to extend (unused) |
parser_class |
type[Parser] |
Parser class to extend (unused) |
renderer_class |
type[HtmlRenderer] |
Renderer class to extend (unused) |