Classes
ChecklistDirective
9
▼
Checklist directive for styled lists with progress tracking.
Syntax:
:::{checklist} Optional T…
ChecklistDirective
9
▼
Checklist directive for styled lists with progress tracking.
Syntax:
:::{checklist} Optional Title
:style: numbered
:show-progress:
:compact:
- Item one
- Item two
- Completed item
- Unchecked item
:::
Options:
:style: Visual style
- default: Standard bullet list styling
- numbered: Ordered list with numbers
- minimal: Minimal styling
:show-progress: Show completion bar for task lists
:compact: Tighter spacing between items
:class: Additional CSS classes
Thread Safety:
Stateless handler. Safe for concurrent use.
Attributes
| Name | Type | Description |
|---|---|---|
names |
ClassVar[tuple[str, ...]]
|
— |
token_type |
ClassVar[str]
|
— |
contract |
ClassVar[DirectiveContract | None]
|
— |
options_class |
ClassVar[type[ChecklistOptions]]
|
— |
Methods
parse
6
Directive
▼
Build checklist AST node.
parse
6
Directive
▼
def parse(self, name: str, title: str | None, options: ChecklistOptions, content: str, children: Sequence[Block], location: SourceLocation) -> Directive
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
|
title |
— |
|
options |
— |
|
content |
— |
|
children |
— |
|
location |
— |
Returns
Directive
render
3
▼
Render checklist to HTML.
render
3
▼
def render(self, node: Directive[ChecklistOptions], rendered_children: str, sb: StringBuilder) -> None
Parameters
| Name | Type | Description |
|---|---|---|
node |
— |
|
rendered_children |
— |
|
sb |
— |
Internal Methods 3 ▼
_make_checkboxes_interactive
1
str
▼
Remove 'disabled' attribute from checkboxes to allow interaction.
_make_checkboxes_interactive
1
str
▼
def _make_checkboxes_interactive(self, html_content: str) -> str
Parameters
| Name | Type | Description |
|---|---|---|
html_content |
— |
Returns
str
_render_progress_script
0
str
▼
Render JavaScript for interactive progress bar updates.
_render_progress_script
0
str
▼
def _render_progress_script(self) -> str
Returns
str
_render_progress_bar
1
str
▼
Calculate and render progress bar from checkbox states.
_render_progress_bar
1
str
▼
def _render_progress_bar(self, html_content: str) -> str
Parameters
| Name | Type | Description |
|---|---|---|
html_content |
— |
Returns
str