Jinja Namespace
When a website build is started, MkNodes will collect as much information as possible about the context by inspecting the distribution info, the local git repository, the remote GitHub repository as well as other project-related information. That information is used to build a context. A large amount of MkNodes fallback to context info if no other info is explicitely set, thus enabling the nodes to display project information without explicitely "hardcoding" the project.
These are the available namespaces available in the Jinja2 environment:¶
metadata
-
- Package information
git
-
- Local repository information
github
-
- Information about the remote repository
theme
- Information about the theme being used
Take a look at the sections in the site nav in order to discover all available information in the environment.
The collected information is also used to populate the MkNodes-specific Jinja2 namespace. In combination with the MkNodes jinja filters, this allows to efficiently write documentation about your project as well as building project-agnostic websites / website parts which can be re-used across different projects.
Rendering CSS files
Data about the used theme (colors etc.) is also part of the context / project information. That information is used then to dynamically create CSS stylesheets during the build process.
Example:¶
This call would pass the module of the current context to MkPipDepTree and let it create a dependency graph:
Page info
Code for this section
Resources
Resources(css=[],
markdown_extensions={'attr_list': {},
'def_list': {},
'md_in_html': {},
'pymdownx.emoji': {'emoji_generator': <function to_svg at 0x7fd7a6931800>,
'emoji_index': <function twemoji at 0x7fd7a69316c0>},
'pymdownx.magiclink': {'repo': 'mknodes',
'repo_url_shorthand': True,
'user': 'phil65'}},
plugins=[],
js=[],
assets=[],
packages=[])