From 559a1e3c34b821284720cca037d0cf3c1f0af4cb Mon Sep 17 00:00:00 2001 From: phil65 Date: Sun, 1 Oct 2023 09:17:38 +0200 Subject: [PATCH] chore: docs --- mknodes/basenodes/mktimeline.py | 4 ++-- mknodes/manual/page_section.py | 3 +++ mknodes/resources/mkpage_index.jinja | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mknodes/basenodes/mktimeline.py b/mknodes/basenodes/mktimeline.py index 289df7a1..def2c45d 100644 --- a/mknodes/basenodes/mktimeline.py +++ b/mknodes/basenodes/mktimeline.py @@ -34,7 +34,7 @@ def __init__( link: str = "", button_text: str = "More", image: str = "", - **kwargs, + **kwargs: Any, ): """Constructor. @@ -151,7 +151,7 @@ def add_item( link: str = "", button_text: str = "More", image: str = "", - **kwargs, + **kwargs: Any, ): """Add a timeline item. diff --git a/mknodes/manual/page_section.py b/mknodes/manual/page_section.py index 9b2ad0a4..528dd8d9 100644 --- a/mknodes/manual/page_section.py +++ b/mknodes/manual/page_section.py @@ -8,6 +8,9 @@ def create_page_section(root_nav: mk.MkNav): root_nav += nav page = nav.add_index_page() page += mk.MkJinjaTemplate("mkpage_index.jinja") + page.footnotes[1] = r"Footnotes are numbered, can be set via \__setitem__." + page.footnotes[2] = r"They can also get nested[^3]." + page.footnotes[3] = mk.MkAdmonition("They can also contain other Markdown (nodes).") page.created_by = create_page_section diff --git a/mknodes/resources/mkpage_index.jinja b/mknodes/resources/mkpage_index.jinja index d079bfee..9a6b7f5c 100644 --- a/mknodes/resources/mkpage_index.jinja +++ b/mknodes/resources/mkpage_index.jinja @@ -75,7 +75,7 @@ MkPages can get created in many ways: Like many other nodes, MkPages inherits from [MkContainer][mknodes.MkContainer] and looks to the outside world like a list, meaning you can add nodes to them by using `+=`, [MkPage.append][mknodes.MkPage.append] or [MkPage.insert][mknodes.MkPage.insert] -Each MkPage also has an [MkFootnotes][mknodes.MkFootNotes] node "embedded" which can be used to easily add footnotes to a page. +Each MkPage also has an [MkFootnotes][mknodes.MkFootNotes] node "embedded" which can be used to easily add footnotes to a page. (Scroll to the bottom to see the result) ``` py title="MkFootnotes embedded" page = MkPage("My page") @@ -90,7 +90,7 @@ During the build process, all Markdown nodes which are part of an [MkPage][mknod The final URL of an [MkPage][mknodes.MkPage] is determined by its position inside the tree and gets calculated -when the tree gets "serialized" into markdown. The HTML filename is inferred from the Page +when the tree gets "serialized" into markdown. The HTML filename is inferred from the page title in case no specific path is given.