Skip to content

Plugin configuration

Info

Since MkNodes is building template HTMLs in the background, you need to set to the theme custom_dir to an existing folder. This folder must be placed outside of the docs/ dir.

auto_delete_generated_templates class-attribute instance-attribute

auto_delete_generated_templates = Type(bool, default=True)

Delete the generated HTML templates when build is finished.

MkNodes may generate HTML template overrides during the build process and deletes them after build. Using this setting, the deletion can be prevented.

build_fn class-attribute instance-attribute

build_fn = Type(str, default='mkdocs_mknodes:parse')

Path to the build script / callable.

Possible formats:

  • my.module:Class.build_fn (must be a classmethod / staticmethod)
  • my.module:build_fn
  • path/to/file.py:build_fn

Can also be remote. The targeted callable gets the project instance as an argument and optionally keyword arguments from setting below.

build_folder class-attribute instance-attribute

build_folder = Optional(Type(str))

Folder to create the Markdown files in.

If no folder is set, MkNodes will generate a temporary dir.

clone_depth class-attribute instance-attribute

clone_depth = Type(int, default=100)

Clone depth in case the repository is remote. (Required for git-changelog).

global_resources class-attribute instance-attribute

global_resources = Type(bool, default=True)

Make resources globally available.

If True, then the resources inferred from the nodes will be put into all HTML pages. (This reflects the "default" MkDocs mechanism of putting extra CSS / JS into the config file) If False, then MkNodes will put the CSS / JS only into the pages which need it. (the resources will be moved into the appropriate page template blocks)

jinja_block_end_string class-attribute instance-attribute

jinja_block_end_string = Optional(Type(str))

Jinja block end string.

jinja_block_start_string class-attribute instance-attribute

jinja_block_start_string = Optional(Type(str))

Jinja block start string.

jinja_extensions class-attribute instance-attribute

jinja_extensions = Optional(ListOfItems(Type(str)))

List containing additional jinja extensions to use.

Examples:

plugins:
- mknodes:
    jinja_extensions:
    - jinja2_ansible_filters.AnsibleCoreFiltersExtension

jinja_loaders class-attribute instance-attribute

jinja_loaders = Optional(ListOfItems(Type(dict)))

List containing additional jinja loaders to use.

Dictionaries must have the type key set to either "filesystem" or "fsspec".

Examples:

plugins:
- mknodes:
    jinja_loaders:
    - type: fsspec
      path: github://
      repo: mknodes
      org: phil65

jinja_on_undefined class-attribute instance-attribute

jinja_on_undefined = Type(str, default='strict')

Jinja undefined macro behavior.

jinja_variable_end_string class-attribute instance-attribute

jinja_variable_end_string = Optional(Type(str))

Jinja variable end string.

jinja_variable_start_string class-attribute instance-attribute

jinja_variable_start_string = Optional(Type(str))

Jinja variable start string.

kwargs class-attribute instance-attribute

kwargs = Optional(Type(dict))

Keyword arguments passed to the build script / callable.

Build scripts may have keyword arguments. You can set them by using this setting.

llm_base_url class-attribute instance-attribute

llm_base_url = Type(str, default='http://localhost:11434')

Base URL for LLM usage.

llm_model_name class-attribute instance-attribute

llm_model_name = Optional(Type(str))

LLM model name to use.

llm_token class-attribute instance-attribute

llm_token = Optional(Type(str))

(Optional) token for the LLM API.

render_by_default class-attribute instance-attribute

render_by_default = Type(bool, default=True)

Render all pages in the jinja environment.

This allows to render jinja in the MkNodes environment outside of the MkJinja nodes.

This setting can be overridden by setting the page metadata field "render_macros".

repo_path class-attribute instance-attribute

repo_path = Type(str, default='.')

Path to the repository to create a website for. (http://....my_project.git)

rewrite_theme_templates class-attribute instance-attribute

rewrite_theme_templates = Type(bool, default=True)

Add additional functionality to themes by rewriting template files.

MkNodes can rewrite the HTML templates of Themes in order to add additional functionality.

Right now, enabling this feature allows these options for the Material-MkDocs theme: - use iconify icons instead of the Material-MkDocs icons - setting the theme features "navigation.indexes" and "navigation.expand" via page metadata.

show_page_info class-attribute instance-attribute

show_page_info = Type(bool, default=False)

Append an admonition box with build-related information.

If True, all pages get added an expandable admonition box at the bottom, containing information about the created page. This includes: - Metadata - Resources - Code which created the page (needs the page to be created via decorators, or the generated_by attribute of the MkPage needs to be set manually)

get_builder

get_builder() -> Callable[..., Any]

get_jinja_config

get_jinja_config() -> EnvConfig