Classes
RubricOptions
dataclass
Options for rubric directive.
RubricOptions
dataclass Options for rubric directive.
DirectiveOptionsAttributes
| Name | Type | Description |
|---|---|---|
css_class |
str |
Additional CSS classes |
_field_aliases |
ClassVar[dict[str, str]] |
RubricDirective
Rubric directive for pseudo-headings.
Syntax:
:::{rubric} Parameters
:class: rubric-parame…
RubricDirective
Rubric directive for pseudo-headings.
Syntax:
:::{rubric} Parameters
:class: rubric-parameters
:::
Creates styled text that looks like a heading but doesn't appear in TOC. The rubric renders immediately with no content inside - any content is ignored.
Use cases:
- API documentation section labels (Parameters, Returns, Raises)
- Section dividers that shouldn't be in navigation
- Styled labels without heading semantics
BengalDirectiveAttributes
| Name | Type | Description |
|---|---|---|
NAMES |
ClassVar[list[str]] |
|
TOKEN_TYPE |
ClassVar[str] |
|
OPTIONS_CLASS |
ClassVar[type[DirectiveOptions]] |
|
DIRECTIVE_NAMES |
ClassVar[list[str]] |
Methods 2
parse_directive
Build rubric token from parsed components.
Rubrics are label-only - children a…
parse_directive
def parse_directive(self, title: str, options: RubricOptions, content: str, children: list[Any], state: Any) -> DirectiveToken
Build rubric token from parsed components.
Rubrics are label-only - children are always empty.
Parameters 5
title |
str |
|
options |
RubricOptions |
|
content |
str |
|
children |
list[Any] |
|
state |
Any |
Returns
DirectiveToken
render
Render rubric to HTML.
Renders as a styled div with role="heading" for accessi…
render
def render(self, renderer: Any, text: str, **attrs: Any) -> str
Render rubric to HTML.
Renders as a styled div with role="heading" for accessibility. Uses aria-level="5" to not interfere with document outline.
Parameters 2
renderer |
Any |
|
text |
str |
Returns
str
Functions
render_rubric
Legacy render function for backward compatibility.
render_rubric
def render_rubric(renderer: Any, text: str, **attrs: Any) -> str
Legacy render function for backward compatibility.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
renderer |
Any |
— | |
text |
str |
— |
Returns
str