Super simple header node.¶
Name | Children | Inherits |
---|---|---|
MkNode mknodes.basenodes.mknode Base class for everything which can be expressed as Markup. |
graph TD
94721311200512["mkheader.MkHeader"]
94721308848336["mknode.MkNode"]
94721311766592["node.Node"]
140564252373184["builtins.object"]
94721308848336 --> 94721311200512
94721311766592 --> 94721308848336
140564252373184 --> 94721311766592
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkheader/metadata.toml
[metadata]
icon = "mdi:format-header-pound"
name = "MkHeader"
group = "base"
[examples.regular]
title = "Regular"
jinja = """
{{ "Header with level 2" | MkHeader(level=2) }}
"""
[examples.header_levels]
title = "Header levels"
jinja = """
{% for i in range(1, 7) %}
{{ ("Header level " ~ i) | MkHeader(level=i) }}
{% endfor %}
"""
[output.markdown]
template = """
{{ "#" * node.level }} {{ node.text }}{% if node.exclude_from_search %} { data-search-exclude }{% endif %}
"""
# [output.html]
# template = """
# <h{{ node.level }}>{{ node.text }}</h{{ node.level }}>
# """
[output.rst]
template = """
{% set line = {1: '#' , 2: '*' , 3: '=' , 4: '-' , 5: '^' , 6: '"' }[node.level] * (node.text | length) %}
{{ line }}
{{ node.text }}
{{ line }}
"""