MkHtmlBlock
:fa-brands-github: Show source on GitHub
PyMdown-based Html block. Can be used to show raw content.¶
Example: Regular¶
Bases: MkBlock
__init__
¶
__init__(
content: str | MkNode = "",
block_type: BlockTypeStr = "div",
*,
markdown_mode: MarkdownModeStr | None = None,
attributes: dict[str, Any] | None = None,
**kwargs: Any
) -> None
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str | MkNode
|
What should be contained in the block |
''
|
block_type
|
BlockTypeStr
|
Block type |
'div'
|
markdown_mode
|
MarkdownModeStr | None
|
Markdown mode |
None
|
attributes
|
dict[str, Any] | None
|
Block attrs |
None
|
kwargs
|
Any
|
Keyword arguments passed to parent |
{}
|
| Name | Children | Inherits |
|---|---|---|
| MkBlock mknodes.basenodes.mkblock PyMdown-based block. |
graph TD
2214384146["mkhtmlblock.MkHtmlBlock"]
1483073837["mkblock.MkBlock"]
835538629["mkcontainer.MkContainer"]
1956333208["mkcontainer.MkContainerBase"]
1359323199["mknode.MkNode"]
2751680898["builtins.object"]
1483073837 --> 2214384146
835538629 --> 1483073837
1956333208 --> 835538629
1359323199 --> 1956333208
2751680898 --> 1359323199
/home/runner/work/mknodes/mknodes/src/mknodes/basenodes/mkhtmlblock/metadata.toml
[metadata]
icon = "octicon:code-16"
name = "MkHtmlBlock"
[requirements.extension."pymdownx.blocks.html"]
[examples.regular]
title = "Regular"
jinja = """
{{ "Different types." | MkHtmlBlock("div") }}
"""
[output.markdown]
template = """
{{ node.fence_boundary }} html{% if node.argument %}{{ node.argument | add(prefix=' | ')}}{% endif %}
{{ node.attributes_block }}
{{ node.get_content_block() }}{{ node.fence_boundary }}
"""
Page info
Code for this page
Resources
Resources(css=[],
markdown_extensions={'admonition': {},
'pymdownx.blocks.html': {},
'pymdownx.details': {},
'pymdownx.highlight': {'anchor_linenums': True,
'line_spans': '__span',
'pygments_lang_class': True},
'pymdownx.superfences': {'custom_fences': [{'class': 'mermaid',
'format': <function fence_code_format at 0x703933662e50>,
'name': 'mermaid'}]},
'pymdownx.tabbed': {},
'tables': {}},
plugins=[Plugin('mkdocstrings')],
js=[],
assets=[],
packages=[])