Skip to content

MkModulePage

TODO: THIS NODE ISNT READY FOR PRIMETIME YET

An MkModulePage is an MkPage subclass used to display information about a specific module. It uses a Jinja template to display the module-related information. By default, the Docstrings and tables showing the contained classes and submodules. The template can be adjusted manually in case a different layout is preferred.

Bases: MkTemplatePage

Page showing information about a module.

__init__

__init__(
    module: tuple[str, ...] | str | ModuleType,
    *,
    klasses: list[type] | set[type] | None = None,
    reexported: list[type] | None = None,
    title: str | None = None,
    template_path: str | None = None,
    **kwargs: Any
) -> None

Constructor.

Parameters:

Name Type Description Default
module tuple[str, ...] | str | ModuleType

ModuleType or path to model to show info for.

required
klasses list[type] | set[type] | None

klasses to use

None
reexported list[type] | None

Classes the module re-exports, documented on other pages

None
title str | None

Optional title override. Defaults to module name

None
template_path str | None

Name of the template to load

None
kwargs Any

further keyword arguments passed to parent

{}

This is an example for an MkModulePage with the default layout, applied to mknodes.info:

/// html | div[style='border: 1px solid red;']


created: source_filename: /home/runner/work/mknodes/mknodes/src/mknodes/pages/mkmodulepage/init.py source_function: MkModulePage.init source_line_no: 52 inclusion_level: false title: info


Class info

🛈 DocStrings

Information/Metadata- related classes.

///

Page info
Code for this page
mknodes.manual.page_section._
@nav.route.page("MkModulePage")
def _(page: mk.MkPage) -> None:
    from mknodes import info

    variables = dict(example_module=info)
    page += mk.MkTemplate("pages/mkmodulepage.jinja", variables=variables)
Resources
Resources(css=[],
          markdown_extensions={},
          plugins=[Plugin('mkdocstrings')],
          js=[],
          assets=[],
          packages=[])
Metadata
created:
  source_filename: /home/runner/work/mknodes/mknodes/.venv/lib/python3.13/site-packages/anyenv/async_run.py
  source_function: run_sync.<locals>.wrapper
  source_line_no: 52
title: MkModulePage