scripts.mkdocs_hooks¶
MkDocs hooks that publish machine-readable documentation artifacts.
View the complete module source at #L1-L225.
API details¶
Each callable below includes its exact signature, type annotations, inputs, defaults, return contract, documented exceptions, implementation source, and parsed docstring sections when the source provides them.
scripts.mkdocs_hooks
¶
MkDocs hooks that publish machine-readable documentation artifacts.
scripts.mkdocs_hooks.SOURCE_BRANCH_URL
module-attribute
¶
scripts.mkdocs_hooks._source_revision
cached
¶
Return the immutable commit represented by this documentation build.
Source code in scripts/mkdocs_hooks.py
scripts.mkdocs_hooks._pin_source_links
¶
Replace mutable gh-pages source links with one commit permalink.
scripts.mkdocs_hooks.on_page_markdown
¶
scripts.mkdocs_hooks.on_post_page
¶
Normalize search alternates and localized homepage presentation.
Source code in scripts/mkdocs_hooks.py
scripts.mkdocs_hooks._markdown_documents
¶
Return tracked hand-written documentation pages in stable order.
Source code in scripts/mkdocs_hooks.py
scripts.mkdocs_hooks.on_post_build
¶
Write Markdown mirrors, the API inventory, and the full LLM corpus.
Source code in scripts/mkdocs_hooks.py
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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
Complete contract reference¶
Expand any definition for its exact inputs, annotations, defaults, return contract, directly raised exceptions, source-grounded behavior, and immutable line link. This section includes private and nested definitions that ordinary API generators omit.
scripts.mkdocs_hooks._source_revision · function
Return the immutable commit represented by this documentation build.
Parameters
This callable has no explicit inputs.
Returns
- Type:
str - Direct return expressions:
candidate.lower();revision
Exceptions and behavior
Function _source_revision calls os.environ.get, re.fullmatch, candidate.lower, subprocess.run; can raise ValueError; has 2 explicit return paths.
Directly raised exceptions: ValueError.
scripts.mkdocs_hooks._pin_source_links · function
Replace mutable gh-pages source links with one commit permalink.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
text |
str |
yes |
none |
Required positional or keyword input. |
revision |
str |
yes |
none |
Required positional or keyword input. |
Returns
- Type:
str - Direct return expressions:
text.replace(SOURCE_BRANCH_URL, f'https://github.com/waybarrios/vllm-mlx/blob/{revision}/')
Exceptions and behavior
Function _pin_source_links calls text.replace; returns text.replace(SOURCE_BRANCH_URL, f'https://github.com/waybarrios/vllm-mlx/blob/{revision}/').
No direct raise statement appears in this definition.
scripts.mkdocs_hooks.on_page_markdown · function
Pin every rendered GitHub source link to the build commit.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
markdown |
str |
yes |
none |
Required positional or keyword input. |
**kwargs |
not annotated |
no |
none |
Additional variadic keyword inputs accepted by this callable. |
Returns
- Type:
str - Direct return expressions:
_pin_source_links(markdown, _source_revision())
Exceptions and behavior
Function on_page_markdown calls _pin_source_links, _source_revision; returns _pin_source_links(markdown, _source_revision()).
No direct raise statement appears in this definition.
scripts.mkdocs_hooks.on_post_page · function
Normalize search alternates and localized homepage presentation.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
output |
str |
yes |
none |
Required positional or keyword input. |
page |
not annotated |
no |
None |
Optional positional or keyword input; defaults to None. |
**kwargs |
not annotated |
no |
none |
Additional variadic keyword inputs accepted by this callable. |
Returns
- Type:
str - Direct return expressions:
output;re.sub('\\s*<a\\b(?=[^>]*\\brel=\\"edit\\")[^>]*>.*?</a>', '', output, count=1, flags=re.DOTALL)
Exceptions and behavior
Function on_post_page calls getattr, re.sub; has 2 explicit return paths.
No direct raise statement appears in this definition.
scripts.mkdocs_hooks._markdown_documents · function
Return tracked hand-written documentation pages in stable order.
Parameters
This callable has no explicit inputs.
Returns
- Type:
list[Path] - Direct return expressions:
sorted((path for path in (REPOSITORY_ROOT / 'docs').rglob('*.md') if not path.read_text(encoding='utf-8').startswith('<…
Exceptions and behavior
Function _markdown_documents calls sorted, (REPOSITORY_ROOT / 'docs').rglob, path.read_text(encoding='utf-8').startswith, path.read_text; returns sorted((path for path in (REPOSITORY_ROOT / 'docs').rglob('*.md') if not path.read_text(encoding='utf-8').startswith('<….
No direct raise statement appears in this definition.
scripts.mkdocs_hooks.on_post_build · function
Write Markdown mirrors, the API inventory, and the full LLM corpus.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
config |
not annotated |
yes |
none |
Required positional or keyword input. |
**kwargs |
not annotated |
no |
none |
Additional variadic keyword inputs accepted by this callable. |
Returns
- Type:
None
Exceptions and behavior
Function on_post_build calls Path, build_inventory, build_repository_inventory, build_cli_inventory.
No direct raise statement appears in this definition.
Complete symbol map¶
This map also includes private definitions and nested helpers. The signature column exposes every explicit input even when an internal helper has no dedicated parameter prose.
| Symbol | Kind | Signature and inputs | What it does | Source |
|---|---|---|---|---|
_source_revision |
function | _source_revision() -> str |
Return the immutable commit represented by this documentation build. | #L27-L46 |
_pin_source_links |
function | _pin_source_links(text: str, revision: str) -> str |
Replace mutable gh-pages source links with one commit permalink. | #L49-L55 |
on_page_markdown |
function | on_page_markdown(markdown: str, **kwargs) -> str |
Pin every rendered GitHub source link to the build commit. | #L58-L62 |
on_post_page |
function | on_post_page(output: str, page = None, **kwargs) -> str |
Normalize search alternates and localized homepage presentation. | #L65-L89 |
_markdown_documents |
function | _markdown_documents() -> list[Path] |
Return tracked hand-written documentation pages in stable order. | #L92-L101 |
on_post_build |
function | on_post_build(config, **kwargs) -> None |
Write Markdown mirrors, the API inventory, and the full LLM corpus. | #L104-L225 |