Classes
BreadcrumbsOptions
dataclass
Options for breadcrumbs directive.
BreadcrumbsOptions
dataclass Options for breadcrumbs directive.
DirectiveOptionsAttributes
| Name | Type | Description |
|---|---|---|
separator |
str |
Separator character between items (default: ›) |
show_home |
bool |
Whether to show home link (default: true) |
home_text |
str |
Text for home link (default: Home) |
home_url |
str |
URL for home link (default: /) |
_field_aliases |
ClassVar[dict[str, str]] |
BreadcrumbsDirective
Auto-generate breadcrumb navigation from page ancestors.
Syntax:
:::{breadcrumbs}
:separat…
BreadcrumbsDirective
Auto-generate breadcrumb navigation from page ancestors.
Syntax:
:::{breadcrumbs}
:separator: /
:show-home: true
:home-text: Home
:::
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 breadcrumbs token.
parse_directive
def parse_directive(self, title: str, options: BreadcrumbsOptions, content: str, children: list[Any], state: Any) -> DirectiveToken
Build breadcrumbs token.
Parameters 5
title |
str |
|
options |
BreadcrumbsOptions |
|
content |
str |
|
children |
list[Any] |
|
state |
Any |
Returns
DirectiveToken
render
Render breadcrumb navigation from page ancestors.
render
def render(self, renderer: Any, text: str, **attrs: Any) -> str
Render breadcrumb navigation from page ancestors.
Parameters 2
renderer |
Any |
|
text |
str |
Returns
str
SiblingsOptions
dataclass
Options for siblings directive.
SiblingsOptions
dataclass Options for siblings directive.
DirectiveOptionsAttributes
| Name | Type | Description |
|---|---|---|
limit |
int |
Maximum number of siblings to show (0 = no limit) |
exclude_current |
bool |
Whether to exclude current page |
show_description |
bool |
Whether to show page descriptions |
_field_aliases |
ClassVar[dict[str, str]] |
SiblingsDirective
Show other pages in the same section.
Syntax:
:::{siblings}
:limit: 10
:exclude-curren…
SiblingsDirective
Show other pages in the same section.
Syntax:
:::{siblings}
:limit: 10
:exclude-current: true
:show-description: true
:::
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 siblings token.
parse_directive
def parse_directive(self, title: str, options: SiblingsOptions, content: str, children: list[Any], state: Any) -> DirectiveToken
Build siblings token.
Parameters 5
title |
str |
|
options |
SiblingsOptions |
|
content |
str |
|
children |
list[Any] |
|
state |
Any |
Returns
DirectiveToken
render
Render sibling pages in the same section.
render
def render(self, renderer: Any, text: str, **attrs: Any) -> str
Render sibling pages in the same section.
Parameters 2
renderer |
Any |
|
text |
str |
Returns
str
PrevNextOptions
dataclass
Options for prev-next directive.
PrevNextOptions
dataclass Options for prev-next directive.
DirectiveOptionsAttributes
| Name | Type | Description |
|---|---|---|
show_title |
bool |
Whether to show page titles |
show_section |
bool |
Whether to show section names |
_field_aliases |
ClassVar[dict[str, str]] |
PrevNextDirective
Section-aware previous/next navigation.
Syntax:
:::{prev-next}
:show-title: true
:show…
PrevNextDirective
Section-aware previous/next navigation.
Syntax:
:::{prev-next}
:show-title: true
:show-section: false
:::
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 prev-next token.
parse_directive
def parse_directive(self, title: str, options: PrevNextOptions, content: str, children: list[Any], state: Any) -> DirectiveToken
Build prev-next token.
Parameters 5
title |
str |
|
options |
PrevNextOptions |
|
content |
str |
|
children |
list[Any] |
|
state |
Any |
Returns
DirectiveToken
render
Render previous/next navigation links.
render
def render(self, renderer: Any, text: str, **attrs: Any) -> str
Render previous/next navigation links.
Parameters 2
renderer |
Any |
|
text |
str |
Returns
str
RelatedOptions
dataclass
Options for related directive.
RelatedOptions
dataclass Options for related directive.
DirectiveOptionsAttributes
| Name | Type | Description |
|---|---|---|
limit |
int |
Maximum number of related items (default: 5) |
title |
str |
Section title (default: Related Articles) |
show_tags |
bool |
Whether to show tags |
_field_aliases |
ClassVar[dict[str, str]] |
RelatedDirective
Show related content based on tags.
Syntax:
:::{related}
:limit: 5
:title: Related Art…
RelatedDirective
Show related content based on tags.
Syntax:
:::{related}
:limit: 5
:title: Related Articles
:show-tags: true
:::
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 related token.
parse_directive
def parse_directive(self, title: str, options: RelatedOptions, content: str, children: list[Any], state: Any) -> DirectiveToken
Build related token.
Parameters 5
title |
str |
|
options |
RelatedOptions |
|
content |
str |
|
children |
list[Any] |
|
state |
Any |
Returns
DirectiveToken
render
Render related content based on tags.
render
def render(self, renderer: Any, text: str, **attrs: Any) -> str
Render related content based on tags.
Parameters 2
renderer |
Any |
|
text |
str |
Returns
str
Functions
_get_section_url
Get URL for a section.
_get_section_url
def _get_section_url(section: Any) -> str
Get URL for a section.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
section |
Any |
— |
Returns
str
render_breadcrumbs
Legacy render function for backward compatibility.
render_breadcrumbs
def render_breadcrumbs(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
render_siblings
Legacy render function for backward compatibility.
render_siblings
def render_siblings(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
render_prev_next
Legacy render function for backward compatibility.
render_prev_next
def render_prev_next(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
render_related
Legacy render function for backward compatibility.
render_related
def render_related(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