MkDetailsBlock
Pymdownx-based details box.¶
Bases: MkBlock
__init__
¶
__init__(
content: str | list | MkNode | None = None,
*,
typ: AdmonitionTypeStr = "info",
expanded: bool | None = None,
title: str | None = None,
**kwargs: Any
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
content
|
str | list | MkNode | None
|
Admonition content |
None
|
typ
|
AdmonitionTypeStr
|
Admonition type |
'info'
|
expanded
|
bool | None
|
Whether the details block should be expanded initially |
None
|
title
|
str | None
|
Optional Admonition title |
None
|
kwargs
|
Any
|
Keyword arguments passed to parent |
{}
|
Name | Children | Inherits |
---|---|---|
MkBlock mknodes.basenodes.mkblock PyMdown-based block. |
graph TD
93860738889984["mkdetailsblock.MkDetailsBlock"]
93860744078912["mkblock.MkBlock"]
93860744077920["mkcontainer.MkContainer"]
93860744073616["mknode.MkNode"]
93860744080896["node.Node"]
140589822947552["builtins.object"]
93860744078912 --> 93860738889984
93860744077920 --> 93860744078912
93860744073616 --> 93860744077920
93860744080896 --> 93860744073616
140589822947552 --> 93860744080896
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkdetailsblock/metadata.toml
[metadata]
icon = "octicon:info-16"
name = "MkDetailsBlock"
[requirements.extension."pymdownx.blocks.details"]
[examples.regular]
title = "Regular"
jinja = """
{{ "Different types." | MkDetailsBlock(typ="warning") }}
"""
[examples.collapsible]
title = "Collapsible and expandable"
jinja = """
{{ "MkDetailsBlocks can also be expanded." | MkDetailsBlock(expanded=True) }}
"""
[output.markdown]
template = """
{{ node.fence_boundary }} details{% if node.argument %}" | " ~ {{ node.argument }}{% endif %}
type: {{ node.typ }}
{% if node.expanded %} open: True
{% endif %}
{{ node.items | join }}
{{ node.fence_boundary }}
"""