writers
Class info¶
Re-exported classes¶
| Class | Module | Description |
|---|---|---|
| GeneratedFolder | mkdocs_mknodes.writers.base | A folder that may contain both hand-written and generated files. |
| Writer | mkdocs_mknodes.writers.base | Turns a BuildOutput into the input files of a static site engine. |
| ZensicalWriter | mkdocs_mknodes.writers.zensical | Write a BuildOutput as Zensical input: docs folder + generated config. |
š DocStrings¶
Writers turning a BuildOutput into the input of a static site engine.
GeneratedFolder
¶
A folder that may contain both hand-written and generated files.
Generated files are tracked in a .gitignore manifest inside the folder (so git
ignores them, and the next run knows which files it owns). Files that exist but are
not listed in the manifest are considered hand-written and never overwritten.
If the folder already contains a hand-written .gitignore, the manifest goes into
.mknodes-generated instead (and the files are not git-ignored).
Source code in mkdocs_mknodes/writers/base.py
__init__
¶
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The folder |
required |
owned
|
bool
|
Whether the whole folder is generated (no hand-written files inside) |
False
|
Source code in mkdocs_mknodes/writers/base.py
finish
¶
Delete stale generated files and write the manifest. Returns removed paths.
Source code in mkdocs_mknodes/writers/base.py
write
¶
Write a generated file unless a hand-written file exists at that path.
Returns True if the file was written (or is already up to date).
Source code in mkdocs_mknodes/writers/base.py
Writer
¶
Turns a BuildOutput into the input files of a static site engine.
Source code in mkdocs_mknodes/writers/base.py
build_command
¶
Return the command which builds (or serves) the written site.
write
¶
write(output: BuildOutput) -> Path
ZensicalWriter
¶
Bases: Writer
Write a BuildOutput as Zensical input: docs folder + generated config.
Source code in mkdocs_mknodes/writers/zensical.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | |
build_config
¶
build_config(
output: BuildOutput,
*,
templates_dir: str | None = None,
social: list[dict[str, str]] | None = None
) -> dict[str, Any]
Return the generated config (to be layered over the source config).