mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Deployed f56717201 with MkDocs version: 1.6.0
This commit is contained in:
@@ -26,39 +26,94 @@
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Keep headings consistent. */
|
||||
h1.doc-heading,
|
||||
h2.doc-heading,
|
||||
h3.doc-heading,
|
||||
h4.doc-heading,
|
||||
h5.doc-heading,
|
||||
h6.doc-heading {
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
/* Backward-compatibility: docstring section titles in bold. */
|
||||
.doc-section-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Symbols in Navigation and ToC. */
|
||||
:root,
|
||||
[data-md-color-scheme="default"] {
|
||||
--doc-symbol-attribute-fg-color: #953800;
|
||||
--doc-symbol-function-fg-color: #8250df;
|
||||
--doc-symbol-method-fg-color: #8250df;
|
||||
--doc-symbol-class-fg-color: #0550ae;
|
||||
--doc-symbol-module-fg-color: #5cad0f;
|
||||
|
||||
--doc-symbol-attribute-bg-color: #9538001a;
|
||||
--doc-symbol-function-bg-color: #8250df1a;
|
||||
--doc-symbol-method-bg-color: #8250df1a;
|
||||
--doc-symbol-class-bg-color: #0550ae1a;
|
||||
--doc-symbol-module-bg-color: #5cad0f1a;
|
||||
}
|
||||
|
||||
[data-md-color-scheme="slate"] {
|
||||
--doc-symbol-attribute-fg-color: #ffa657;
|
||||
--doc-symbol-function-fg-color: #d2a8ff;
|
||||
--doc-symbol-method-fg-color: #d2a8ff;
|
||||
--doc-symbol-class-fg-color: #79c0ff;
|
||||
--doc-symbol-module-fg-color: #baff79;
|
||||
|
||||
--doc-symbol-attribute-bg-color: #ffa6571a;
|
||||
--doc-symbol-function-bg-color: #d2a8ff1a;
|
||||
--doc-symbol-method-bg-color: #d2a8ff1a;
|
||||
--doc-symbol-class-bg-color: #79c0ff1a;
|
||||
--doc-symbol-module-bg-color: #baff791a;
|
||||
}
|
||||
|
||||
code.doc-symbol {
|
||||
border-radius: .1rem;
|
||||
font-size: .85em;
|
||||
padding: 0 .3em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
code.doc-symbol-attribute {
|
||||
color: var(--doc-symbol-attribute-fg-color);
|
||||
background-color: var(--doc-symbol-attribute-bg-color);
|
||||
}
|
||||
|
||||
code.doc-symbol-attribute::after {
|
||||
content: "attr";
|
||||
}
|
||||
|
||||
code.doc-symbol-function {
|
||||
color: var(--doc-symbol-function-fg-color);
|
||||
background-color: var(--doc-symbol-function-bg-color);
|
||||
}
|
||||
|
||||
code.doc-symbol-function::after {
|
||||
content: "func";
|
||||
}
|
||||
|
||||
code.doc-symbol-method {
|
||||
color: var(--doc-symbol-method-fg-color);
|
||||
background-color: var(--doc-symbol-method-bg-color);
|
||||
}
|
||||
|
||||
code.doc-symbol-method::after {
|
||||
content: "meth";
|
||||
}
|
||||
|
||||
code.doc-symbol-class {
|
||||
color: var(--doc-symbol-class-fg-color);
|
||||
background-color: var(--doc-symbol-class-bg-color);
|
||||
}
|
||||
|
||||
code.doc-symbol-class::after {
|
||||
content: "class";
|
||||
}
|
||||
|
||||
code.doc-symbol-module {
|
||||
color: var(--doc-symbol-module-fg-color);
|
||||
background-color: var(--doc-symbol-module-bg-color);
|
||||
}
|
||||
|
||||
code.doc-symbol-module::after {
|
||||
content: "mod";
|
||||
}
|
||||
|
||||
.doc-signature .autorefs {
|
||||
color: inherit;
|
||||
text-transform: none;
|
||||
border-bottom: 1px dotted currentcolor;
|
||||
}
|
||||
|
||||
h1.doc-heading {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
h2.doc-heading {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
h3.doc-heading {
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
h4.doc-heading {
|
||||
font-size: 1.10rem;
|
||||
}
|
||||
|
||||
h5.doc-heading {
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
h6.doc-heading {
|
||||
font-size: 1rem;
|
||||
}
|
||||
@@ -244,7 +244,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="mkdocs.structure.files.Files" class="doc doc-heading">
|
||||
<code>mkdocs.structure.files.Files</code>
|
||||
|
||||
@@ -272,7 +271,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.src_paths" class="doc doc-heading">
|
||||
<code class="highlight language-python">src_paths: dict[str, File]</code>
|
||||
|
||||
@@ -294,7 +292,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.src_uris" class="doc doc-heading">
|
||||
<code class="highlight language-python">src_uris: Mapping[str, File]</code>
|
||||
|
||||
@@ -320,7 +317,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.__iter__" class="doc doc-heading">
|
||||
<code class="highlight language-python">__iter__() -> Iterator[File]</code>
|
||||
|
||||
@@ -340,7 +336,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.__len__" class="doc doc-heading">
|
||||
<code class="highlight language-python">__len__() -> int</code>
|
||||
|
||||
@@ -360,7 +355,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.__contains__" class="doc doc-heading">
|
||||
<code class="highlight language-python">__contains__(path: str) -> bool</code>
|
||||
|
||||
@@ -380,7 +374,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.get_file_from_path" class="doc doc-heading">
|
||||
<code class="highlight language-python">get_file_from_path(path: str) -> File | None</code>
|
||||
|
||||
@@ -400,7 +393,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.append" class="doc doc-heading">
|
||||
<code class="highlight language-python">append(file: File) -> None</code>
|
||||
|
||||
@@ -420,7 +412,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.remove" class="doc doc-heading">
|
||||
<code class="highlight language-python">remove(file: File) -> None</code>
|
||||
|
||||
@@ -440,7 +431,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.copy_static_files" class="doc doc-heading">
|
||||
<code class="highlight language-python">copy_static_files(dirty: bool = False, *, inclusion: Callable[[InclusionLevel], bool] = InclusionLevel.is_included) -> None</code>
|
||||
|
||||
@@ -460,7 +450,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.documentation_pages" class="doc doc-heading">
|
||||
<code class="highlight language-python">documentation_pages(*, inclusion: Callable[[InclusionLevel], bool] = InclusionLevel.is_included) -> Sequence[File]</code>
|
||||
|
||||
@@ -480,7 +469,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.static_pages" class="doc doc-heading">
|
||||
<code class="highlight language-python">static_pages() -> Sequence[File]</code>
|
||||
|
||||
@@ -500,7 +488,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.media_files" class="doc doc-heading">
|
||||
<code class="highlight language-python">media_files() -> Sequence[File]</code>
|
||||
|
||||
@@ -520,7 +507,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.javascript_files" class="doc doc-heading">
|
||||
<code class="highlight language-python">javascript_files() -> Sequence[File]</code>
|
||||
|
||||
@@ -540,7 +526,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.css_files" class="doc doc-heading">
|
||||
<code class="highlight language-python">css_files() -> Sequence[File]</code>
|
||||
|
||||
@@ -560,7 +545,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.Files.add_files_from_theme" class="doc doc-heading">
|
||||
<code class="highlight language-python">add_files_from_theme(env: jinja2.Environment, config: MkDocsConfig) -> None</code>
|
||||
|
||||
@@ -581,13 +565,13 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="mkdocs.structure.files.File" class="doc doc-heading">
|
||||
<code>mkdocs.structure.files.File</code>
|
||||
|
||||
@@ -639,7 +623,6 @@ additional transformations to the path, based on <code>use_directory_urls</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.src_uri" class="doc doc-heading">
|
||||
<code class="highlight language-python">src_uri: str</code>
|
||||
|
||||
@@ -661,7 +644,6 @@ additional transformations to the path, based on <code>use_directory_urls</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.generated_by" class="doc doc-heading">
|
||||
<code class="highlight language-python">generated_by: str | None = None</code>
|
||||
|
||||
@@ -685,7 +667,6 @@ additional transformations to the path, based on <code>use_directory_urls</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.dest_path" class="doc doc-heading">
|
||||
<code class="highlight language-python">dest_path: str</code>
|
||||
|
||||
@@ -708,7 +689,6 @@ additional transformations to the path, based on <code>use_directory_urls</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.src_path" class="doc doc-heading">
|
||||
<code class="highlight language-python">src_path: str = path</code>
|
||||
|
||||
@@ -732,7 +712,6 @@ additional transformations to the path, based on <code>use_directory_urls</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.src_dir" class="doc doc-heading">
|
||||
<code class="highlight language-python">src_dir: str | None = src_dir</code>
|
||||
|
||||
@@ -755,7 +734,6 @@ additional transformations to the path, based on <code>use_directory_urls</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.dest_dir" class="doc doc-heading">
|
||||
<code class="highlight language-python">dest_dir: str = dest_dir</code>
|
||||
|
||||
@@ -777,7 +755,6 @@ additional transformations to the path, based on <code>use_directory_urls</code>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.use_directory_urls" class="doc doc-heading">
|
||||
<code class="highlight language-python">use_directory_urls: bool = use_directory_urls</code>
|
||||
|
||||
@@ -803,7 +780,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.inclusion" class="doc doc-heading">
|
||||
<code class="highlight language-python">inclusion: InclusionLevel = inclusion</code>
|
||||
|
||||
@@ -826,7 +802,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.name" class="doc doc-heading">
|
||||
<code class="highlight language-python">name = cached_property(_get_stem)</code>
|
||||
|
||||
@@ -849,7 +824,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.dest_uri" class="doc doc-heading">
|
||||
<code class="highlight language-python">dest_uri = cached_property(_get_dest_path)</code>
|
||||
|
||||
@@ -872,7 +846,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.url" class="doc doc-heading">
|
||||
<code class="highlight language-python">url = cached_property(_get_url)</code>
|
||||
|
||||
@@ -895,7 +868,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.abs_src_path" class="doc doc-heading">
|
||||
<code class="highlight language-python">abs_src_path: str | None</code>
|
||||
|
||||
@@ -919,7 +891,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.abs_dest_path" class="doc doc-heading">
|
||||
<code class="highlight language-python">abs_dest_path: str</code>
|
||||
|
||||
@@ -942,7 +913,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.content_bytes" class="doc doc-heading">
|
||||
<code class="highlight language-python">content_bytes: bytes</code>
|
||||
|
||||
@@ -967,7 +937,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.content_string" class="doc doc-heading">
|
||||
<code class="highlight language-python">content_string: str</code>
|
||||
|
||||
@@ -995,7 +964,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.generated" class="doc doc-heading">
|
||||
<code class="highlight language-python">generated(config: MkDocsConfig, src_uri: str, *, content: str | bytes | None = None, abs_src_path: str | None = None, inclusion: InclusionLevel = InclusionLevel.UNDEFINED) -> File</code>
|
||||
|
||||
@@ -1020,7 +988,6 @@ original path.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.edit_uri" class="doc doc-heading">
|
||||
<code class="highlight language-python">edit_uri() -> str | None</code>
|
||||
|
||||
@@ -1042,7 +1009,6 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.url_relative_to" class="doc doc-heading">
|
||||
<code class="highlight language-python">url_relative_to(other: File | str) -> str</code>
|
||||
|
||||
@@ -1062,7 +1028,6 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.copy_file" class="doc doc-heading">
|
||||
<code class="highlight language-python">copy_file(dirty: bool = False) -> None</code>
|
||||
|
||||
@@ -1082,7 +1047,6 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.is_documentation_page" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_documentation_page() -> bool</code>
|
||||
|
||||
@@ -1102,7 +1066,6 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.is_static_page" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_static_page() -> bool</code>
|
||||
|
||||
@@ -1122,7 +1085,6 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.is_media_file" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_media_file() -> bool</code>
|
||||
|
||||
@@ -1142,7 +1104,6 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.is_javascript" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_javascript() -> bool</code>
|
||||
|
||||
@@ -1162,7 +1123,6 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.structure.files.File.is_css" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_css() -> bool</code>
|
||||
|
||||
@@ -1183,13 +1143,13 @@ For generated files this should be set to <code>None</code>.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="mkdocs.config.base.Config" class="doc doc-heading">
|
||||
<code>mkdocs.config.base.Config</code>
|
||||
|
||||
@@ -1225,7 +1185,6 @@ For examples, see mkdocs/contrib/search/<strong>init</strong>.py and mkdocs/conf
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.config.base.Config.__new__" class="doc doc-heading">
|
||||
<code class="highlight language-python">__new__(*args, **kwargs) -> Config</code>
|
||||
|
||||
@@ -1245,7 +1204,6 @@ For examples, see mkdocs/contrib/search/<strong>init</strong>.py and mkdocs/conf
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.config.base.Config.set_defaults" class="doc doc-heading">
|
||||
<code class="highlight language-python">set_defaults() -> None</code>
|
||||
|
||||
@@ -1266,7 +1224,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.config.base.Config.load_dict" class="doc doc-heading">
|
||||
<code class="highlight language-python">load_dict(patch: dict) -> None</code>
|
||||
|
||||
@@ -1286,7 +1243,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.config.base.Config.load_file" class="doc doc-heading">
|
||||
<code class="highlight language-python">load_file(config_file: IO) -> None</code>
|
||||
|
||||
@@ -1307,13 +1263,13 @@ default if it has one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="mkdocs.utils.templates.TemplateContext" class="doc doc-heading">
|
||||
<code>mkdocs.utils.templates.TemplateContext</code>
|
||||
|
||||
@@ -1341,7 +1297,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.nav" class="doc doc-heading">
|
||||
<code class="highlight language-python">nav: Navigation</code>
|
||||
|
||||
@@ -1361,7 +1316,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.pages" class="doc doc-heading">
|
||||
<code class="highlight language-python">pages: Sequence[File]</code>
|
||||
|
||||
@@ -1381,7 +1335,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.base_url" class="doc doc-heading">
|
||||
<code class="highlight language-python">base_url: str</code>
|
||||
|
||||
@@ -1401,7 +1354,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.extra_css" class="doc doc-heading">
|
||||
<code class="highlight language-python">extra_css: Sequence[str]</code>
|
||||
|
||||
@@ -1421,7 +1373,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.extra_javascript" class="doc doc-heading">
|
||||
<code class="highlight language-python">extra_javascript: Sequence[str]</code>
|
||||
|
||||
@@ -1441,7 +1392,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.mkdocs_version" class="doc doc-heading">
|
||||
<code class="highlight language-python">mkdocs_version: str</code>
|
||||
|
||||
@@ -1461,7 +1411,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.build_date_utc" class="doc doc-heading">
|
||||
<code class="highlight language-python">build_date_utc: datetime.datetime</code>
|
||||
|
||||
@@ -1481,7 +1430,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.config" class="doc doc-heading">
|
||||
<code class="highlight language-python">config: MkDocsConfig</code>
|
||||
|
||||
@@ -1501,7 +1449,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.utils.templates.TemplateContext.page" class="doc doc-heading">
|
||||
<code class="highlight language-python">page: Page | None</code>
|
||||
|
||||
@@ -1525,13 +1472,13 @@ default if it has one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 id="mkdocs.livereload.LiveReloadServer" class="doc doc-heading">
|
||||
<code>mkdocs.livereload.LiveReloadServer</code>
|
||||
|
||||
@@ -1562,7 +1509,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.livereload.LiveReloadServer.watch" class="doc doc-heading">
|
||||
<code class="highlight language-python">watch(path: str, func: None = None, *, recursive: bool = True) -> None</code>
|
||||
|
||||
@@ -1582,7 +1528,6 @@ default if it has one.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="mkdocs.livereload.LiveReloadServer.unwatch" class="doc doc-heading">
|
||||
<code class="highlight language-python">unwatch(path: str) -> None</code>
|
||||
|
||||
@@ -1603,6 +1548,7 @@ default if it has one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -299,8 +299,9 @@ class MyPlugin(mkdocs.plugins.BasePlugin[MyPluginConfig]):
|
||||
...</code></pre>
|
||||
</div>
|
||||
<h5 id="examples-of-config-definitions">Examples of config definitions<a class="headerlink" href="#examples-of-config-definitions" title="Permanent link"></a></h5>
|
||||
<blockquote>
|
||||
<p>! EXAMPLE:</p>
|
||||
<details class="example" open="open">
|
||||
<summary>Example</summary>
|
||||
<p>
|
||||
<pre class="highlight"><code class="language-python">from mkdocs.config import base, config_options as c
|
||||
|
||||
class _ValidationOptions(base.Config):
|
||||
@@ -311,7 +312,7 @@ class _ValidationOptions(base.Config):
|
||||
class MyPluginConfig(base.Config):
|
||||
definition_file = c.File(exists=True) # required
|
||||
checksum_file = c.Optional(c.File(exists=True)) # can be None but must exist if specified
|
||||
validation = c.SubConfig(_ValidationOptions)</code></pre>
|
||||
validation = c.SubConfig(_ValidationOptions)</code></pre></p>
|
||||
<p>From the user's point of view <code>SubConfig</code> is similar to <code>Type(dict)</code>, it's just that it also retains full ability for validation: you define all valid keys and what each value should adhere to.</p>
|
||||
<p>And <code>ListOfItems</code> is similar to <code>Type(list)</code>, but again, we define the constraint that each value must adhere to.</p>
|
||||
<p>This accepts a config as follows:</p>
|
||||
@@ -323,10 +324,11 @@ class MyPluginConfig(base.Config):
|
||||
skip_checks:
|
||||
- foo
|
||||
- baz</code></pre>
|
||||
</blockquote>
|
||||
</details>
|
||||
<!-- -->
|
||||
<blockquote>
|
||||
<p>? EXAMPLE:</p>
|
||||
<details class="example">
|
||||
<summary>Example</summary>
|
||||
<p>
|
||||
<pre class="highlight"><code class="language-python">import numbers
|
||||
from mkdocs.config import base, config_options as c
|
||||
|
||||
@@ -335,7 +337,7 @@ class _Rectangle(base.Config):
|
||||
height = c.Type(numbers.Real) # required
|
||||
|
||||
class MyPluginConfig(base.Config):
|
||||
add_rectangles = c.ListOfItems(c.SubConfig(_Rectangle)) # required</code></pre>
|
||||
add_rectangles = c.ListOfItems(c.SubConfig(_Rectangle)) # required</code></pre></p>
|
||||
<p>In this example we define a list of complex items, and that's achieved by passing a concrete <code>SubConfig</code> to <code>ListOfItems</code>.</p>
|
||||
<p>This accepts a config as follows:</p>
|
||||
<pre class="highlight"><code class="language-yaml">my_plugin:
|
||||
@@ -344,7 +346,7 @@ class MyPluginConfig(base.Config):
|
||||
height: 7
|
||||
- width: 12
|
||||
height: 2</code></pre>
|
||||
</blockquote>
|
||||
</details>
|
||||
<p>When the user's configuration is loaded, the above scheme will be used to
|
||||
validate the configuration and fill in any defaults for settings not
|
||||
provided by the user. The validation classes may be any of the classes
|
||||
@@ -1209,6 +1211,7 @@ the theme config:</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>startup</code> event runs once at the very beginning of an <code>mkdocs</code> invocation.</p>
|
||||
@@ -1220,9 +1223,9 @@ For initializing per-build variables (and whenever in doubt), use the <code>on_c
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>command</code></b>
|
||||
(<code><span title="typing.Literal">Literal</span>['build', 'gh-deploy', 'serve']</code>)
|
||||
–
|
||||
@@ -1230,7 +1233,7 @@ For initializing per-build variables (and whenever in doubt), use the <code>on_c
|
||||
<p>the command that MkDocs was invoked with, e.g. "serve" for <code>mkdocs serve</code>.</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>dirty</code></b>
|
||||
(<code>bool</code>)
|
||||
–
|
||||
@@ -1251,6 +1254,7 @@ For initializing per-build variables (and whenever in doubt), use the <code>on_c
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>shutdown</code> event runs once at the very end of an <code>mkdocs</code> invocation, before exiting.</p>
|
||||
@@ -1274,6 +1278,7 @@ relies on detecting a graceful shutdown of MkDocs.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>serve</code> event is only called when the <code>serve</code> command is used during
|
||||
@@ -1284,9 +1289,9 @@ to the list of "watched" files for auto-reloading.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>server</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.livereload.LiveReloadServer" href="../api/#mkdocs.livereload.LiveReloadServer">LiveReloadServer</a></code>)
|
||||
–
|
||||
@@ -1294,7 +1299,7 @@ to the list of "watched" files for auto-reloading.</p>
|
||||
<p><code>livereload.Server</code> instance</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1302,7 +1307,7 @@ to the list of "watched" files for auto-reloading.</p>
|
||||
<p>global configuration object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>builder</code></b>
|
||||
(<code><span title="typing.Callable">Callable</span></code>)
|
||||
–
|
||||
@@ -1314,9 +1319,9 @@ to the list of "watched" files for auto-reloading.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><a class="autorefs autorefs-internal" title="mkdocs.livereload.LiveReloadServer" href="../api/#mkdocs.livereload.LiveReloadServer">LiveReloadServer</a> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1340,6 +1345,7 @@ entire site.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>config</code> event is the first event called on build and is run immediately
|
||||
@@ -1348,9 +1354,9 @@ config should be made here.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1362,9 +1368,9 @@ config should be made here.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1384,6 +1390,7 @@ config should be made here.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>pre_build</code> event does not alter any variables. Use this event to call
|
||||
@@ -1391,9 +1398,9 @@ pre-build scripts.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1414,6 +1421,7 @@ pre-build scripts.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>files</code> event is called after the files collection is populated from the
|
||||
@@ -1424,9 +1432,9 @@ specific data.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>files</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.files.Files" href="../api/#mkdocs.structure.files.Files">Files</a></code>)
|
||||
–
|
||||
@@ -1434,7 +1442,7 @@ specific data.</p>
|
||||
<p>global files collection</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1446,9 +1454,9 @@ specific data.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><a class="autorefs autorefs-internal" title="mkdocs.structure.files.Files" href="../api/#mkdocs.structure.files.Files">Files</a> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1468,6 +1476,7 @@ specific data.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>nav</code> event is called after the site navigation is created and can
|
||||
@@ -1475,9 +1484,9 @@ be used to alter the site navigation.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>nav</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.nav.Navigation" href="../themes/#mkdocs.structure.nav.Navigation">Navigation</a></code>)
|
||||
–
|
||||
@@ -1485,7 +1494,7 @@ be used to alter the site navigation.</p>
|
||||
<p>global navigation object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1493,7 +1502,7 @@ be used to alter the site navigation.</p>
|
||||
<p>global configuration object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>files</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.files.Files" href="../api/#mkdocs.structure.files.Files">Files</a></code>)
|
||||
–
|
||||
@@ -1505,9 +1514,9 @@ be used to alter the site navigation.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><a class="autorefs autorefs-internal" title="mkdocs.structure.nav.Navigation" href="../themes/#mkdocs.structure.nav.Navigation">Navigation</a> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1527,6 +1536,7 @@ be used to alter the site navigation.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>env</code> event is called after the Jinja template environment is created
|
||||
@@ -1535,9 +1545,9 @@ and can be used to alter the
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>env</code></b>
|
||||
(<code><span title="jinja2.Environment">Environment</span></code>)
|
||||
–
|
||||
@@ -1545,7 +1555,7 @@ and can be used to alter the
|
||||
<p>global Jinja environment</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1553,7 +1563,7 @@ and can be used to alter the
|
||||
<p>global configuration object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>files</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.files.Files" href="../api/#mkdocs.structure.files.Files">Files</a></code>)
|
||||
–
|
||||
@@ -1565,9 +1575,9 @@ and can be used to alter the
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><span title="jinja2.Environment">Environment</span> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1587,6 +1597,7 @@ and can be used to alter the
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>post_build</code> event does not alter any variables. Use this event to call
|
||||
@@ -1594,9 +1605,9 @@ post-build scripts.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1617,6 +1628,7 @@ post-build scripts.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>build_error</code> event is called after an exception of any kind
|
||||
@@ -1627,9 +1639,9 @@ events which were scheduled to run after the error will have been skipped. See
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>error</code></b>
|
||||
(<code>Exception</code>)
|
||||
–
|
||||
@@ -1655,6 +1667,7 @@ called after the <a href="#on_env">env</a> event and before any <a href="#page-e
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>pre_template</code> event is called immediately after the subject template is
|
||||
@@ -1662,9 +1675,9 @@ loaded and can be used to alter the template.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>template</code></b>
|
||||
(<code><span title="jinja2.Template">Template</span></code>)
|
||||
–
|
||||
@@ -1672,7 +1685,7 @@ loaded and can be used to alter the template.</p>
|
||||
<p>a Jinja2 <a href="https://jinja.palletsprojects.com/en/latest/api/#jinja2.Template">Template</a> object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>template_name</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -1680,7 +1693,7 @@ loaded and can be used to alter the template.</p>
|
||||
<p>string filename of template</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1692,9 +1705,9 @@ loaded and can be used to alter the template.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><span title="jinja2.Template">Template</span> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1714,6 +1727,7 @@ loaded and can be used to alter the template.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>template_context</code> event is called immediately after the context is created
|
||||
@@ -1722,9 +1736,9 @@ template only.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>context</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.utils.templates.TemplateContext" href="../api/#mkdocs.utils.templates.TemplateContext">TemplateContext</a></code>)
|
||||
–
|
||||
@@ -1732,7 +1746,7 @@ template only.</p>
|
||||
<p>dict of template context variables</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>template_name</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -1740,7 +1754,7 @@ template only.</p>
|
||||
<p>string filename of template</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1752,9 +1766,9 @@ template only.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><a class="autorefs autorefs-internal" title="mkdocs.utils.templates.TemplateContext" href="../api/#mkdocs.utils.templates.TemplateContext">TemplateContext</a> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1774,6 +1788,7 @@ template only.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>post_template</code> event is called after the template is rendered, but before
|
||||
@@ -1783,9 +1798,9 @@ written to disc.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>output_content</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -1793,7 +1808,7 @@ written to disc.</p>
|
||||
<p>output of rendered template as string</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>template_name</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -1801,7 +1816,7 @@ written to disc.</p>
|
||||
<p>string filename of template</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1813,9 +1828,9 @@ written to disc.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code>str | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1839,6 +1854,7 @@ page events are called after the <a href="#on_post_template">post_template</a> e
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>pre_page</code> event is called before any actions are taken on the subject
|
||||
@@ -1846,9 +1862,9 @@ page and can be used to alter the <code>Page</code> instance.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>page</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.pages.Page" href="../themes/#mkdocs.structure.pages.Page">Page</a></code>)
|
||||
–
|
||||
@@ -1856,7 +1872,7 @@ page and can be used to alter the <code>Page</code> instance.</p>
|
||||
<p><code>mkdocs.structure.pages.Page</code> instance</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1864,7 +1880,7 @@ page and can be used to alter the <code>Page</code> instance.</p>
|
||||
<p>global configuration object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>files</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.files.Files" href="../api/#mkdocs.structure.files.Files">Files</a></code>)
|
||||
–
|
||||
@@ -1876,9 +1892,9 @@ page and can be used to alter the <code>Page</code> instance.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><a class="autorefs autorefs-internal" title="mkdocs.structure.pages.Page" href="../themes/#mkdocs.structure.pages.Page">Page</a> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1898,6 +1914,7 @@ page and can be used to alter the <code>Page</code> instance.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<div class="admonition deprecated">
|
||||
@@ -1913,9 +1930,9 @@ the contents of a page's source from the filesystem.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>page</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.pages.Page" href="../themes/#mkdocs.structure.pages.Page">Page</a></code>)
|
||||
–
|
||||
@@ -1923,7 +1940,7 @@ the contents of a page's source from the filesystem.</p>
|
||||
<p><code>mkdocs.structure.pages.Page</code> instance</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1935,9 +1952,9 @@ the contents of a page's source from the filesystem.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code>str | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -1958,6 +1975,7 @@ default loading from a file will be performed.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>page_markdown</code> event is called after the page's markdown is loaded
|
||||
@@ -1966,9 +1984,9 @@ data has been stripped off and is available as <code>page.meta</code> at this po
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>markdown</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -1976,7 +1994,7 @@ data has been stripped off and is available as <code>page.meta</code> at this po
|
||||
<p>Markdown source text of page as string</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>page</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.pages.Page" href="../themes/#mkdocs.structure.pages.Page">Page</a></code>)
|
||||
–
|
||||
@@ -1984,7 +2002,7 @@ data has been stripped off and is available as <code>page.meta</code> at this po
|
||||
<p><code>mkdocs.structure.pages.Page</code> instance</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -1992,7 +2010,7 @@ data has been stripped off and is available as <code>page.meta</code> at this po
|
||||
<p>global configuration object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>files</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.files.Files" href="../api/#mkdocs.structure.files.Files">Files</a></code>)
|
||||
–
|
||||
@@ -2004,9 +2022,9 @@ data has been stripped off and is available as <code>page.meta</code> at this po
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code>str | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -2026,6 +2044,7 @@ data has been stripped off and is available as <code>page.meta</code> at this po
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>page_content</code> event is called after the Markdown text is rendered to
|
||||
@@ -2034,9 +2053,9 @@ HTML body of the page.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>html</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -2044,7 +2063,7 @@ HTML body of the page.</p>
|
||||
<p>HTML rendered from Markdown source as string</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>page</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.pages.Page" href="../themes/#mkdocs.structure.pages.Page">Page</a></code>)
|
||||
–
|
||||
@@ -2052,7 +2071,7 @@ HTML body of the page.</p>
|
||||
<p><code>mkdocs.structure.pages.Page</code> instance</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -2060,7 +2079,7 @@ HTML body of the page.</p>
|
||||
<p>global configuration object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>files</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.files.Files" href="../api/#mkdocs.structure.files.Files">Files</a></code>)
|
||||
–
|
||||
@@ -2072,9 +2091,9 @@ HTML body of the page.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code>str | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -2094,6 +2113,7 @@ HTML body of the page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>page_context</code> event is called after the context for a page is created
|
||||
@@ -2101,9 +2121,9 @@ and can be used to alter the context for that specific page only.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>context</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.utils.templates.TemplateContext" href="../api/#mkdocs.utils.templates.TemplateContext">TemplateContext</a></code>)
|
||||
–
|
||||
@@ -2111,7 +2131,7 @@ and can be used to alter the context for that specific page only.</p>
|
||||
<p>dict of template context variables</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>page</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.pages.Page" href="../themes/#mkdocs.structure.pages.Page">Page</a></code>)
|
||||
–
|
||||
@@ -2119,7 +2139,7 @@ and can be used to alter the context for that specific page only.</p>
|
||||
<p><code>mkdocs.structure.pages.Page</code> instance</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -2127,7 +2147,7 @@ and can be used to alter the context for that specific page only.</p>
|
||||
<p>global configuration object</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>nav</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.nav.Navigation" href="../themes/#mkdocs.structure.nav.Navigation">Navigation</a></code>)
|
||||
–
|
||||
@@ -2139,9 +2159,9 @@ and can be used to alter the context for that specific page only.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><a class="autorefs autorefs-internal" title="mkdocs.utils.templates.TemplateContext" href="../api/#mkdocs.utils.templates.TemplateContext">TemplateContext</a> | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -2161,6 +2181,7 @@ and can be used to alter the context for that specific page only.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>The <code>post_page</code> event is called after the template is rendered, but
|
||||
@@ -2170,9 +2191,9 @@ written to disc.</p>
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>output</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -2180,7 +2201,7 @@ written to disc.</p>
|
||||
<p>output of rendered template as string</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>page</code></b>
|
||||
(<code><a class="autorefs autorefs-internal" title="mkdocs.structure.pages.Page" href="../themes/#mkdocs.structure.pages.Page">Page</a></code>)
|
||||
–
|
||||
@@ -2188,7 +2209,7 @@ written to disc.</p>
|
||||
<p><code>mkdocs.structure.pages.Page</code> instance</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>config</code></b>
|
||||
(<code><span title="mkdocs.config.defaults.MkDocsConfig">MkDocsConfig</span></code>)
|
||||
–
|
||||
@@ -2200,9 +2221,9 @@ written to disc.</p>
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code>str | None</code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
@@ -2223,7 +2244,6 @@ written to disc.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 id="mkdocs.plugins.event_priority" class="doc doc-heading">
|
||||
<code class="highlight language-python">mkdocs.plugins.event_priority(priority: float) -> Callable[[T], T]</code>
|
||||
|
||||
@@ -2259,7 +2279,6 @@ except ImportError:
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 id="mkdocs.plugins.CombinedEvent" class="doc doc-heading">
|
||||
<code>mkdocs.plugins.CombinedEvent</code>
|
||||
|
||||
@@ -2308,6 +2327,7 @@ instead they can start with <code>_on_</code> like in the the above example, or
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div></div>
|
||||
<h3 id="handling-errors">Handling Errors<a class="headerlink" href="#handling-errors" title="Permanent link"></a></h3>
|
||||
<p>MkDocs defines four error types:</p>
|
||||
@@ -2317,7 +2337,6 @@ instead they can start with <code>_on_</code> like in the the above example, or
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 id="mkdocs.exceptions.MkDocsException" class="doc doc-heading">
|
||||
<code>mkdocs.exceptions.MkDocsException</code>
|
||||
|
||||
@@ -2336,13 +2355,13 @@ not be raised directly. One of the subclasses should be raised instead.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 id="mkdocs.exceptions.ConfigurationError" class="doc doc-heading">
|
||||
<code>mkdocs.exceptions.ConfigurationError</code>
|
||||
|
||||
@@ -2362,13 +2381,13 @@ defined in a plugin's <a class="autorefs autorefs-internal" href="#config_scheme
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 id="mkdocs.exceptions.BuildError" class="doc doc-heading">
|
||||
<code>mkdocs.exceptions.BuildError</code>
|
||||
|
||||
@@ -2387,13 +2406,13 @@ not raise this error.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-class">
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 id="mkdocs.exceptions.PluginError" class="doc doc-heading">
|
||||
<code>mkdocs.exceptions.PluginError</code>
|
||||
|
||||
@@ -2412,6 +2431,7 @@ events.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><p>Unexpected and uncaught exceptions will interrupt the build process and produce
|
||||
typical Python tracebacks, which are useful for debugging your code. However,
|
||||
users generally find tracebacks overwhelming and often miss the helpful error
|
||||
@@ -2466,7 +2486,6 @@ if log.getEffectiveLevel() <= logging.DEBUG:
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 id="mkdocs.plugins.get_plugin_logger" class="doc doc-heading">
|
||||
<code class="highlight language-python">mkdocs.plugins.get_plugin_logger(name: str) -> PrefixedLogger</code>
|
||||
|
||||
@@ -2479,9 +2498,9 @@ if log.getEffectiveLevel() <= logging.DEBUG:
|
||||
|
||||
|
||||
|
||||
<p>Parameters:</p>
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<b><code>name</code></b>
|
||||
(<code>str</code>)
|
||||
–
|
||||
@@ -2493,9 +2512,9 @@ if log.getEffectiveLevel() <= logging.DEBUG:
|
||||
|
||||
|
||||
|
||||
<p>Returns:</p>
|
||||
<p><span class="doc-section-title">Returns:</span></p>
|
||||
<ul>
|
||||
<li class="field-body">
|
||||
<li class="doc-section-item field-body">
|
||||
<code><span title="mkdocs.plugins.PrefixedLogger">PrefixedLogger</span></code>
|
||||
–
|
||||
<div class="doc-md-description">
|
||||
|
||||
@@ -349,8 +349,8 @@ themes for consistency.</p>
|
||||
<p class="admonition-title">Changed in version 1.5:</p>
|
||||
<p>The items of the <code>config.extra_javascript</code> list used to be simple strings but now became objects that have these fields: <code>path</code>, <code>type</code>, <code>async</code>, <code>defer</code>.</p>
|
||||
<p>In that version, MkDocs also gained the <a href="#script_tag"><code>script_tag</code> filter</a>.</p>
|
||||
<blockquote>
|
||||
<p>? EXAMPLE: <strong>Obsolete style:</strong></p>
|
||||
<details class="example">
|
||||
<summary>Obsolete style:</summary>
|
||||
<pre class="highlight"><code class="language-django"> {%- for path in extra_javascript %}
|
||||
<script src="{{ path }}"></script>
|
||||
{%- endfor %}</code></pre>
|
||||
@@ -364,10 +364,10 @@ themes for consistency.</p>
|
||||
<pre class="highlight"><code class="language-django"> {%- for script in config.extra_javascript %}
|
||||
{{ script | script_tag }}
|
||||
{%- endfor %}</code></pre>
|
||||
</blockquote>
|
||||
</details>
|
||||
<p>If you wish to be able to pick up the new customizations while keeping your theme compatible with older versions of MkDocs, use this snippet:</p>
|
||||
<blockquote>
|
||||
<p>! EXAMPLE: <strong>Backwards-compatible style:</strong></p>
|
||||
<details class="example" open="open">
|
||||
<summary>Backwards-compatible style:</summary>
|
||||
<pre class="highlight"><code class="language-django"> {%- for script in config.extra_javascript %}
|
||||
{%- if script.path %} {# Detected MkDocs 1.5+ which has `script.path` and `script_tag` #}
|
||||
{{ script | script_tag }}
|
||||
@@ -375,7 +375,7 @@ themes for consistency.</p>
|
||||
<script src="{{ script | url }}"{% if script.endswith(".mjs") %} type="module"{% endif %}></script>
|
||||
{%- endif %}
|
||||
{%- endfor %}</code></pre>
|
||||
</blockquote>
|
||||
</details>
|
||||
</div>
|
||||
<h2 id="theme-files">Theme Files<a class="headerlink" href="#theme-files" title="Permanent link"></a></h2>
|
||||
<p>There are various files which a theme treats special in some way. Any other
|
||||
@@ -461,6 +461,7 @@ defined by the <a href="../../user-guide/configuration/#nav">nav</a> configurati
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><p>In addition to the iterable of <a href="#navigation-objects">navigation objects</a>, the
|
||||
<code>nav</code> object contains the following attributes:</p>
|
||||
|
||||
@@ -469,7 +470,6 @@ defined by the <a href="../../user-guide/configuration/#nav">nav</a> configurati
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Navigation.homepage" class="doc doc-heading">
|
||||
<code class="highlight language-python">homepage: Page | None</code>
|
||||
|
||||
@@ -491,7 +491,6 @@ defined by the <a href="../../user-guide/configuration/#nav">nav</a> configurati
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Navigation.pages" class="doc doc-heading">
|
||||
<code class="highlight language-python">pages: list[Page]</code>
|
||||
|
||||
@@ -588,6 +587,7 @@ as <code>page</code> <a href="#navigation-objects">navigation objects</a> in the
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><p>All <code>page</code> objects contain the following attributes:</p>
|
||||
|
||||
|
||||
@@ -596,7 +596,6 @@ as <code>page</code> <a href="#navigation-objects">navigation objects</a> in the
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.title" class="doc doc-heading">
|
||||
<code class="highlight language-python">title() -> str | None</code>
|
||||
|
||||
@@ -623,7 +622,6 @@ as <code>page</code> <a href="#navigation-objects">navigation objects</a> in the
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.content" class="doc doc-heading">
|
||||
<code class="highlight language-python">content: str | None</code>
|
||||
|
||||
@@ -646,7 +644,6 @@ as <code>page</code> <a href="#navigation-objects">navigation objects</a> in the
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.toc" class="doc doc-heading">
|
||||
<code class="highlight language-python">toc: TableOfContents</code>
|
||||
|
||||
@@ -679,7 +676,6 @@ for a page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.meta" class="doc doc-heading">
|
||||
<code class="highlight language-python">meta: MutableMapping[str, Any]</code>
|
||||
|
||||
@@ -716,7 +712,6 @@ documentation page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.url" class="doc doc-heading">
|
||||
<code class="highlight language-python">url: str</code>
|
||||
|
||||
@@ -741,7 +736,6 @@ page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.file" class="doc doc-heading">
|
||||
<code class="highlight language-python">file: File</code>
|
||||
|
||||
@@ -763,7 +757,6 @@ page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.abs_url" class="doc doc-heading">
|
||||
<code class="highlight language-python">abs_url: str | None</code>
|
||||
|
||||
@@ -792,7 +785,6 @@ page <code>foo.md</code> would be <code>/bar/foo/</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.canonical_url" class="doc doc-heading">
|
||||
<code class="highlight language-python">canonical_url: str | None</code>
|
||||
|
||||
@@ -817,7 +809,6 @@ variable.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.edit_url" class="doc doc-heading">
|
||||
<code class="highlight language-python">edit_url: str | None</code>
|
||||
|
||||
@@ -841,7 +832,6 @@ variable.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.is_homepage" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_homepage: bool</code>
|
||||
|
||||
@@ -867,7 +857,6 @@ on the homepage:</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.previous_page" class="doc doc-heading">
|
||||
<code class="highlight language-python">previous_page: Page | None</code>
|
||||
|
||||
@@ -891,7 +880,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.next_page" class="doc doc-heading">
|
||||
<code class="highlight language-python">next_page: Page | None</code>
|
||||
|
||||
@@ -915,7 +903,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.StructureItem.parent" class="doc doc-heading">
|
||||
<code class="highlight language-python">parent: Section | None = None</code>
|
||||
|
||||
@@ -938,7 +925,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.children" class="doc doc-heading">
|
||||
<code class="highlight language-python">children: None = None</code>
|
||||
|
||||
@@ -961,7 +947,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.active" class="doc doc-heading">
|
||||
<code class="highlight language-python">active: bool</code>
|
||||
|
||||
@@ -984,7 +969,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.is_section" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_section: bool = False</code>
|
||||
|
||||
@@ -1007,7 +991,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.is_page" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_page: bool = True</code>
|
||||
|
||||
@@ -1030,7 +1013,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.pages.Page.is_link" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_link: bool = False</code>
|
||||
|
||||
@@ -1075,7 +1057,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.toc.AnchorLink.title" class="doc doc-heading">
|
||||
<code class="highlight language-python">title: str</code>
|
||||
|
||||
@@ -1097,7 +1078,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.toc.AnchorLink.url" class="doc doc-heading">
|
||||
<code class="highlight language-python">url: str</code>
|
||||
|
||||
@@ -1119,7 +1099,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.toc.AnchorLink.level" class="doc doc-heading">
|
||||
<code class="highlight language-python">level: int</code>
|
||||
|
||||
@@ -1141,7 +1120,6 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.toc.AnchorLink.children" class="doc doc-heading">
|
||||
<code class="highlight language-python">children: list[AnchorLink]</code>
|
||||
|
||||
@@ -1167,6 +1145,7 @@ or if the current page is not included in the navigation at all.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><h3 id="navigation-objects">Navigation Objects<a class="headerlink" href="#navigation-objects" title="Permanent link"></a></h3>
|
||||
<p>Navigation objects contained in the <a href="#nav">nav</a> template variable may be one of
|
||||
<a href="#section">section</a> objects, <a href="#page">page</a> objects, and <a href="#link">link</a> objects.
|
||||
@@ -1212,6 +1191,7 @@ theme chooses to do so.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><p>The following attributes are available on <code>section</code> objects:</p>
|
||||
|
||||
|
||||
@@ -1219,7 +1199,6 @@ theme chooses to do so.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Section.title" class="doc doc-heading">
|
||||
<code class="highlight language-python">title: str</code>
|
||||
|
||||
@@ -1241,7 +1220,6 @@ theme chooses to do so.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.StructureItem.parent" class="doc doc-heading">
|
||||
<code class="highlight language-python">parent: Section | None = None</code>
|
||||
|
||||
@@ -1264,7 +1242,6 @@ theme chooses to do so.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Section.children" class="doc doc-heading">
|
||||
<code class="highlight language-python">children: list[StructureItem]</code>
|
||||
|
||||
@@ -1286,7 +1263,6 @@ theme chooses to do so.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Section.active" class="doc doc-heading">
|
||||
<code class="highlight language-python">active: bool</code>
|
||||
|
||||
@@ -1311,7 +1287,6 @@ to <code>False</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Section.is_section" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_section: bool = True</code>
|
||||
|
||||
@@ -1334,7 +1309,6 @@ to <code>False</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Section.is_page" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_page: bool = False</code>
|
||||
|
||||
@@ -1357,7 +1331,6 @@ to <code>False</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Section.is_link" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_link: bool = False</code>
|
||||
|
||||
@@ -1408,6 +1381,7 @@ MkDocs page.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><p>The following attributes are available on <code>link</code> objects:</p>
|
||||
|
||||
|
||||
@@ -1415,7 +1389,6 @@ MkDocs page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Link.title" class="doc doc-heading">
|
||||
<code class="highlight language-python">title: str</code>
|
||||
|
||||
@@ -1437,7 +1410,6 @@ MkDocs page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Link.url" class="doc doc-heading">
|
||||
<code class="highlight language-python">url: str</code>
|
||||
|
||||
@@ -1460,7 +1432,6 @@ should not need to have <code>base_url</code> prepended.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.StructureItem.parent" class="doc doc-heading">
|
||||
<code class="highlight language-python">parent: Section | None = None</code>
|
||||
|
||||
@@ -1483,7 +1454,6 @@ should not need to have <code>base_url</code> prepended.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Link.children" class="doc doc-heading">
|
||||
<code class="highlight language-python">children: None = None</code>
|
||||
|
||||
@@ -1506,7 +1476,6 @@ should not need to have <code>base_url</code> prepended.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Link.active" class="doc doc-heading">
|
||||
<code class="highlight language-python">active: bool = False</code>
|
||||
|
||||
@@ -1529,7 +1498,6 @@ should not need to have <code>base_url</code> prepended.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Link.is_section" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_section: bool = False</code>
|
||||
|
||||
@@ -1552,7 +1520,6 @@ should not need to have <code>base_url</code> prepended.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Link.is_page" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_page: bool = False</code>
|
||||
|
||||
@@ -1575,7 +1542,6 @@ should not need to have <code>base_url</code> prepended.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<h5 id="mkdocs.structure.nav.Link.is_link" class="doc doc-heading">
|
||||
<code class="highlight language-python">is_link: bool = True</code>
|
||||
|
||||
|
||||
@@ -377,5 +377,5 @@ configuration file. Start by reading the <a href="getting-started/">introductory
|
||||
|
||||
<!--
|
||||
MkDocs version : 1.6.0
|
||||
Build Date UTC : 2024-04-20 18:03:37.191449+00:00
|
||||
Build Date UTC : 2024-04-21 10:54:18.469314+00:00
|
||||
-->
|
||||
|
||||
101
messages.pot
101
messages.pot
@@ -1,101 +0,0 @@
|
||||
# Translations template for MkDocs.
|
||||
# Copyright (C) 2024 MkDocs
|
||||
# This file is distributed under the same license as the MkDocs project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: MkDocs 1.5.3\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
|
||||
"POT-Creation-Date: 2024-04-18 21:03+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.14.0\n"
|
||||
|
||||
#: mkdocs/themes/mkdocs/404.html:8
|
||||
msgid "Page not found"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/base.html:117
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:31
|
||||
#: mkdocs/themes/mkdocs/search-modal.html:5
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/base.html:127
|
||||
msgid "Previous"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/base.html:132
|
||||
msgid "Next"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/base.html:143 mkdocs/themes/mkdocs/base.html:145
|
||||
#: mkdocs/themes/mkdocs/base.html:147 mkdocs/themes/mkdocs/base.html:149
|
||||
#, python-format
|
||||
msgid "Edit on %(repo_name)s"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/base.html:151
|
||||
msgid "Edit"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/base.html:225
|
||||
#, python-format
|
||||
msgid "Documentation built with %(mkdocs_link)s."
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:5
|
||||
msgid "Keyboard Shortcuts"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:6
|
||||
#: mkdocs/themes/mkdocs/search-modal.html:6
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:12
|
||||
msgid "Keys"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:13
|
||||
msgid "Action"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:19
|
||||
msgid "Open this help"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:23
|
||||
msgid "Next page"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/keyboard-modal.html:27
|
||||
msgid "Previous page"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/search-modal.html:9
|
||||
msgid "From here you can search these documents. Enter your search terms below."
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/search-modal.html:12
|
||||
msgid "Search..."
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/search-modal.html:12
|
||||
msgid "Type search term here"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/search-modal.html:15
|
||||
msgid "No results found"
|
||||
msgstr ""
|
||||
|
||||
#: mkdocs/themes/mkdocs/toc.html:3
|
||||
msgid "Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
File diff suppressed because one or more lines are too long
38
sitemap.xml
38
sitemap.xml
@@ -2,97 +2,97 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/getting-started/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/about/contributing/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/about/license/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/about/release-notes/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/dev-guide/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/dev-guide/api/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/dev-guide/plugins/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/dev-guide/themes/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/dev-guide/translations/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/choosing-your-theme/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/cli/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/configuration/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/customizing-your-theme/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/deploying-your-docs/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/installation/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/localizing-your-theme/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://www.mkdocs.org/user-guide/writing-your-docs/</loc>
|
||||
<lastmod>2024-04-20</lastmod>
|
||||
<lastmod>2024-04-21</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
</urlset>
|
||||
BIN
sitemap.xml.gz
BIN
sitemap.xml.gz
Binary file not shown.
@@ -358,8 +358,8 @@ edit_uri_template: 'blob/main/docs/{path}'</code></pre>
|
||||
<ul>
|
||||
<li><code>{path!q}</code>, e.g. <code>foo%2Fbar.md</code></li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>? NOTE: <strong>Suggested useful configurations:</strong></p>
|
||||
<details class="note">
|
||||
<summary>Suggested useful configurations:</summary>
|
||||
<ul>
|
||||
<li>
|
||||
<p>GitHub Wiki:<br />
|
||||
@@ -385,7 +385,7 @@ edit_uri_template: '-/sse/master/docs%2F{path!q}'</code></pre>
|
||||
<pre class="highlight"><code class="language-yaml">edit_uri_template: 'https://gitlab.com/-/ide/project/repo/edit/master/-/docs/{path}'</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
</details>
|
||||
<p><strong>default</strong>: <code>null</code></p>
|
||||
<h3 id="site_description">site_description<a class="headerlink" href="#site_description" title="Permanent link"></a></h3>
|
||||
<p>Set the site description. This will add a meta tag to the generated HTML header.</p>
|
||||
@@ -510,8 +510,8 @@ not_in_nav: |
|
||||
<p>Configure the strictness of MkDocs' diagnostic messages when validating links to documents.</p>
|
||||
<p>This is a tree of configs, and for each one the value can be one of the three: <code>warn</code>, <code>info</code>, <code>ignore</code>. Which cause a logging message of the corresponding severity to be produced. The <code>warn</code> level is, of course, intended for use with <code>mkdocs build --strict</code> (where it becomes an error), which you can employ in continuous testing.</p>
|
||||
<p>The config <code>validation.links.absolute_links</code> additionally has a special value <code>relative_to_docs</code>, for <a href="#validation-of-absolute-links">validation of absolute links</a>.</p>
|
||||
<blockquote>
|
||||
<p>? EXAMPLE: <strong>Defaults of this config as of MkDocs 1.6:</strong></p>
|
||||
<details class="example">
|
||||
<summary>Defaults of this config as of MkDocs 1.6:</summary>
|
||||
<pre class="highlight"><code class="language-yaml">validation:
|
||||
nav:
|
||||
omitted_files: info
|
||||
@@ -523,24 +523,24 @@ not_in_nav: |
|
||||
absolute_links: info
|
||||
unrecognized_links: info</code></pre>
|
||||
<p>(Note: you shouldn't copy this whole example, because it only duplicates the defaults. Only individual items that differ should be set.)</p>
|
||||
</blockquote>
|
||||
</details>
|
||||
<p>The defaults of some of the behaviors already differ from MkDocs 1.4 and below - they were ignored before.</p>
|
||||
<blockquote>
|
||||
<p>? EXAMPLE: <strong>Configure MkDocs 1.6 to behave like MkDocs 1.4 and below (reduce strictness):</strong></p>
|
||||
<details class="example">
|
||||
<summary>Configure MkDocs 1.6 to behave like MkDocs 1.4 and below (reduce strictness):</summary>
|
||||
<pre class="highlight"><code class="language-yaml">validation:
|
||||
absolute_links: ignore
|
||||
unrecognized_links: ignore
|
||||
anchors: ignore</code></pre>
|
||||
</blockquote>
|
||||
</details>
|
||||
<!-- -->
|
||||
<blockquote>
|
||||
<p>! EXAMPLE: <strong>Recommended settings for most sites (maximal strictness):</strong></p>
|
||||
<details class="example" open="open">
|
||||
<summary>Recommended settings for most sites (maximal strictness):</summary>
|
||||
<pre class="highlight"><code class="language-yaml">validation:
|
||||
omitted_files: warn
|
||||
absolute_links: warn # Or 'relative_to_docs' - new in MkDocs 1.6
|
||||
unrecognized_links: warn
|
||||
anchors: warn # New in MkDocs 1.6</code></pre>
|
||||
</blockquote>
|
||||
</details>
|
||||
<p>Note how in the above examples we omitted the 'nav' and 'links' keys. Here <code>absolute_links:</code> means setting both <code>nav: absolute_links:</code> and <code>links: absolute_links:</code>.</p>
|
||||
<p>Full list of values and examples of log messages that they can hide or make more prominent:</p>
|
||||
<ul>
|
||||
@@ -896,8 +896,8 @@ and available configuration options.</p>
|
||||
<p>Then the file <code>my_hooks.py</code> can contain any <a href="../../dev-guide/plugins/#events">plugin event handlers</a> (without <code>self</code>), e.g.:</p>
|
||||
<pre class="highlight"><code class="language-python">def on_page_markdown(markdown, **kwargs):
|
||||
return markdown.replace('a', 'z')</code></pre>
|
||||
<blockquote>
|
||||
<p>? EXAMPLE: <strong>Advanced example:</strong></p>
|
||||
<details class="example">
|
||||
<summary>Advanced example:</summary>
|
||||
<p>This produces warnings based on the Markdown content (and warnings are fatal in <a href="#strict">strict</a> mode):</p>
|
||||
<pre class="highlight"><code class="language-python">import logging, re
|
||||
import mkdocs.plugins
|
||||
@@ -909,7 +909,7 @@ def on_page_markdown(markdown, page, **kwargs):
|
||||
path = page.file.src_uri
|
||||
for m in re.finditer(r'\bhttp://[^) ]+', markdown):
|
||||
log.warning(f"Documentation file '{path}' contains a non-HTTPS link: {m[0]}")</code></pre>
|
||||
</blockquote>
|
||||
</details>
|
||||
<p>This does not enable any new abilities compared to <a href="../../dev-guide/plugins/">plugins</a>, it only simplifies one-off usages, as these don't need to be <em>installed</em> like plugins do.</p>
|
||||
<p>Note that for <code>mkdocs serve</code> the hook module will <em>not</em> be reloaded on each build.</p>
|
||||
<p>You might have seen this feature in the <a href="https://github.com/aklajnert/mkdocs-simple-hooks">mkdocs-simple-hooks plugin</a>. If using standard method names, it can be directly replaced, e.g.:</p>
|
||||
|
||||
Reference in New Issue
Block a user