settings
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| GeneratorSettings mkdocs_mknodes.generator.settings Settings for generating a website from a MkNodes build function. |
š DocStrings¶
Settings for the engine-agnostic site generator.
Settings are read from (later sources win):
- the
mknodesentry of thepluginslist in the project'smkdocs.yml(kept for sites which were set up for the former MkDocs plugin), [tool.mknodes]inpyproject.toml(preferred; the keys below,-and_are interchangeable),- explicit overrides (CLI options).
Without any configuration, the default website (mkdocs_mknodes:parse) gets generated.
GeneratorSettings
dataclass
¶
Settings for generating a website from a MkNodes build function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_dir
|
Path
|
Return a new path pointing to the current working directory. |
PosixPath('/home/runner/work/mkdocs-mknodes/mkdocs-mknodes')
|
config_file
|
Path | None
|
The site config the generated config inherits from ( |
None
|
build_fn
|
str
|
Build function ( |
'mkdocs_mknodes:parse'
|
kwargs
|
dict[str, Any]
|
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) |
<class 'dict'>
|
repo_path
|
str
|
Repository to build docs for (local path or remote URL). |
'.'
|
clone_depth
|
int
|
Clone depth for remote repositories. |
100
|
show_page_info
|
bool
|
Append a collapsible box with build info to every page. |
False
|
render_by_default
|
bool
|
Render generated pages with the MkNodes Jinja environment. |
True
|
global_resources
|
bool
|
Put CSS / JS into the site config instead of per-page template blocks. |
True
|
docs_dir
|
str | None
|
Docs folder (default: |
None
|
generated_dir
|
str | None
|
Folder to write generated pages into (default: If it differs from |
None
|
generated_config
|
str
|
Filename of the generated site config (relative to the project dir). |
'mkdocs.generated.yml'
|
site_dir
|
str | None
|
Output folder for the HTML build (default: the site config's |
None
|
jinja_loaders
|
list[dict[str, Any]] | None
|
|
None
|
jinja_extensions
|
list[str] | None
|
|
None
|
jinja_block_start_string
|
str | None
|
|
None
|
jinja_block_end_string
|
str | None
|
|
None
|
jinja_variable_start_string
|
str | None
|
|
None
|
jinja_variable_end_string
|
str | None
|
|
None
|
site_config
|
dict[str, Any]
|
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) |
<class 'dict'>
|
Source code in mkdocs_mknodes/generator/settings.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
build_fn
class-attribute
instance-attribute
¶
Build function (module:callable, path/file.py:callable, module:Class.method).
clone_depth
class-attribute
instance-attribute
¶
Clone depth for remote repositories.
config_file
class-attribute
instance-attribute
¶
The site config the generated config inherits from (mkdocs.yml).
docs_dir
class-attribute
instance-attribute
¶
Docs folder (default: docs_dir of the site config, else docs).
generated_config
class-attribute
instance-attribute
¶
Filename of the generated site config (relative to the project dir).
generated_dir
class-attribute
instance-attribute
¶
Folder to write generated pages into (default: docs_dir).
If it differs from docs_dir, hand-written pages get mirrored into it and it becomes
the docs dir of the generated config.
global_resources
class-attribute
instance-attribute
¶
Put CSS / JS into the site config instead of per-page template blocks.
kwargs
class-attribute
instance-attribute
¶
Keyword arguments for the build function (pages for the default build function).
project_dir
class-attribute
instance-attribute
¶
Root folder of the project (contains mkdocs.yml / pyproject.toml).
render_by_default
class-attribute
instance-attribute
¶
Render generated pages with the MkNodes Jinja environment.
repo_path
class-attribute
instance-attribute
¶
Repository to build docs for (local path or remote URL).
show_page_info
class-attribute
instance-attribute
¶
Append a collapsible box with build info to every page.
site_config
class-attribute
instance-attribute
¶
The loaded site config (INHERIT resolved, custom tags preserved).
site_dir
class-attribute
instance-attribute
¶
Output folder for the HTML build (default: the site config's site_dir).
get_builder
¶
Return the build function with the configured kwargs bound.
Source code in mkdocs_mknodes/generator/settings.py
load
classmethod
¶
load(
project_dir: str | PathLike[str] | None = None,
config_file: str | PathLike[str] | None = None,
**overrides: Any
) -> GeneratorSettings
Load settings for given project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_dir
|
str | PathLike[str] | None
|
Project root (default: cwd, or the folder of |
None
|
config_file
|
str | PathLike[str] | None
|
Site config to read (default: |
None
|
overrides
|
Any
|
Explicit setting overrides ( |
{}
|
Source code in mkdocs_mknodes/generator/settings.py
get_plugin_config
¶
Return the (!ENV-resolved) mknodes plugin options from a MkDocs config.