Classes
ListTableDirective
List table directive using MyST syntax.
Syntax:
:::{list-table}
:header-rows: 1
:width…
ListTableDirective
List table directive using MyST syntax.
Syntax:
:::{list-table}
:header-rows: 1
:widths: 20 30 50
* - Header 1
- Header 2
- Header 3
- Row 1, Col 1
- Row 1, Col 2
- Row 1, Col 3
- Row 2, Col 1
- Row 2, Col 2
- Row 2, Col 3 :::
Supports:
- :header-rows: number - Number of header rows (default: 0)
- :widths: space-separated percentages - Column widths
- :class: CSS class for the table
Inherits from
DirectivePluginMethods 1
parse
Parse list-table directive.
parse
def parse(self, block: Any, m: Match[str], state: Any) -> dict[str, Any]
Parse list-table directive.
Parameters 3
block |
Any |
Block parser |
m |
Match[str] |
Regex match object |
state |
Any |
Parser state |
Returns
Token dict with type 'list_table'dict[str, Any]
—
Internal Methods 2
_parse_list_rows
Parse list content into table rows.
_parse_list_rows
def _parse_list_rows(self, content: str) -> list[list[str]]
Parse list content into table rows.
Parameters 1
content |
str |
Raw content string |
Returns
List of rows, where each row is a list of cell contentslist[list[str]]
—
__call__
Register the directive and renderer.
__call__
def __call__(self, directive: Any, md: Any) -> Any
Register the directive and renderer.
Parameters 2
directive |
Any |
|
md |
Any |
Returns
Any
Functions
render_list_table
Render list table to HTML.
render_list_table
def render_list_table(renderer: Any, text: str, **attrs: Any) -> str
Render list table to HTML.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
renderer |
Any |
— | Mistune renderer |
text |
str |
— | Rendered children content (unused for list tables) **attrs: Table attributes from directive |
Returns
HTML string for list tablestr
—