Metadata
Description¶
Every MkPage as well as every [MkNav][mknodes.MkNav] can carry metadata. Page metadata inherits from Nav metadata, similarly as the MkDocs-Material meta plugin.
Metadata can be set either via the MkPage constructor, via the MkNav.route.page decorator. Also, some methods like [MkNav.parse.folder][mknodes.navs.navparser.NavParser.folder] take metadata keyword arguments in order to set it for all parsed pages.
Examples¶
Via decorators:
Via constructor:
Metadata fields¶
The Metadata class is a subclassed Python dictionary.
It is enhanced with properties for common metadata fields in order to get proper type hints. Since this object is a dict subclass, you can of course also add any non-documented stuff to the Metadata.
exclude_from_search
property
writable
¶
exclude_from_search: bool | None
Exclude this page from search.
hide
property
writable
¶
hide: list[SectionStr] | None
A list of items which should be hidden from the page.
MkDocs-Material supports "navigation"
, "toc"
, "path"
, "tags"
.
render_macros
property
writable
¶
render_macros: bool | None
Whether this page should get rendered by the templating engine.
search
property
writable
¶
search: dict | None
A dictionary containing search-related settings ("boost"
/ "exclude"
).
search_boost
property
writable
¶
search_boost: float | None
A multiplier to modify search relevance.
status
property
writable
¶
status: PageStatusStr | str | None
The status of the page.
MkDocs-Material supports "new"
, "deprecated"
and "encrypted"
by default
by showing an icon in the site nav. Additional icons can be added during
the build process via
[MaterialTheme.add_status_icon][mknodes.MaterialTheme.add_status_icon].
template
property
writable
¶
template: str | None
Filename of the template the page should use.
This is only a reference, you still need to add the template to the theme.
Page info
Code for this page
Resources
Resources(css=[],
markdown_extensions={'attr_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=[Plugin('mkdocstrings')],
js=[],
assets=[],
packages=[])