What is MkNodes?
There are a lot of different ways MkNodes can be used to generate websites. This section will highlight some of them.
MkNodes can be used in many different ways
-
Create complete websites
- MkNodes can be used to create a whole website (like it is done with this page)
The most useful setup probably would be to put the whole navigation into code,
create MkCodes via code when the complexity favours that, and otherwise just
use
MkPage.from_file
orMkTemplate
to embed static pages. That way you can get the best of both worlds, the simplicity from writing markdown files combined with the possibilities of using python for repititive work or more complex / dynamic tasks.
- MkNodes can be used to create a whole website (like it is done with this page)
The most useful setup probably would be to put the whole navigation into code,
create MkCodes via code when the complexity favours that, and otherwise just
use
-
Load existing markdown content and extend it.
- By using
MkNav.parse.folder
/MkNav.parse.file
as well asMkPage.from_file
, the existing Markdown pages can become part of our tree (which we can then extend programatically). You dont need to start from ground up if you have an existing documentation.
- By using
-
Create a subsection with MkNodes and reference it from your "static" page.
- You can also create an MkNodes tree and reference that tree from your
nav:
section in mkdocs.yml.
- You can also create an MkNodes tree and reference that tree from your
-
Create single static pages / blocks for your page You can also just use MkNodes to create some Nodes, stringify them and include the markdown in your static pages. It can also be used to create your GitHub / PyPi overview page.
-
Using
Markdown-Exec
or similar inline execution plugins You can also embed MkNodes code directly by using various plug-ins (personal recommendation:Markdown-Exec
) For most cases the built-in jinja environment should include enough to display complex Markdown in an easy way. -
Create "multi-pages" MkNodes can even "merge" multiple websites into one. In its core, MkNodes is nothing more than one large tree ranging from the start page down to individual markdown elements. It is very easy to make a complete website tree the subtree of another Parent-tree.
-
Create a "structure template" for multiple sites MkNodes separates content and appearance for writing documentation. Website templates can be written in a way that they work for multiple websites without any manual adaption.
Page info
Code for this page
Resources
Resources(css=[],
markdown_extensions={'attr_list': {},
'md_in_html': {},
'pymdownx.emoji': {'emoji_generator': <function to_svg at 0x7f6e52627c40>,
'emoji_index': <function twemoji at 0x7f6e52627b00>},
'pymdownx.magiclink': {'repo': 'mkdocs_mknodes',
'repo_url_shorthand': True,
'user': 'phil65'}},
plugins=[],
js=[],
assets=[],
packages=[])