MkAnnotations
Node containing a list of MkAnnotations.¶
Name | Children | Inherits |
---|---|---|
MkContainer mknodes.basenodes.mkcontainer A node containing other MkNodes. |
graph TD
94599703823296["mkannotations.MkAnnotations"]
94599705096240["mkcontainer.MkContainer"]
94599705097232["mknode.MkNode"]
94599703461184["node.Node"]
140153667328480["builtins.object"]
94599705096240 --> 94599703823296
94599705097232 --> 94599705096240
94599703461184 --> 94599705097232
140153667328480 --> 94599703461184
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkannotations/metadata.toml
[metadata]
name = "MkAnnotations"
icon = "mdi:alert-box"
[requirements.extension."pymdownx.superfences"]
[examples.python]
python = """
import mknodes as mk
page += mk.MkCode.for_object(mk.MkCode.for_object, extract_body=True)
node = MkAnnotations()
page += node
text = mk.MkText("The MkAnnotations node aggregates annotations(1).")
page += text
info = r"Annotations are numbered and can be set via \\__setitem__."
node[1] = info # (1)
admonition = mk.MkAdmonition("They can also contain other Markdown.")
node[2] = admonition # (2)
text.annotations[1] = "Every MkNode can annotate via the 'annotations' attribute"
page += mk.MkCode(str(node), language="markdown", header="Markdown")
"""
[fragments.annotation]
template = """
{{ node.num }}.{{ 3 - self.num | string | length }}{{ node.items | join("\n\n") | indent }}
"""
[output.markdown]
template = """
{{ node.items | sort(attribute="num") | join }}
"""
mknodes.basenodes.mkannotations.MkAnnotations | |
---|---|
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|