serve
Class info¶
🛈 DocStrings¶
catch_exceptions
¶
catch_exceptions(config: MkNodesConfig)
Context manager used to clean up in case of build error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
MkNodesConfig
|
Build config. |
required |
Source code in mkdocs_mknodes/commands/serve.py
77 78 79 80 81 82 83 84 85 86 87 88 89 | |
serve
¶
serve(
config_path: str | PathLike[str] = CFG_DEFAULT,
repo_path: str = ".",
build_fn: str = DEFAULT_BUILD_FN,
clone_depth: int = 100,
theme: str | None = None,
**kwargs: Any
)
Serve a MkNodes-based website.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str | PathLike[str]
|
The path to the config file to use |
CFG_DEFAULT
|
repo_path
|
str
|
Path to the repository a page should be built for |
'.'
|
build_fn
|
str
|
Callable to use for creating the webpage |
DEFAULT_BUILD_FN
|
clone_depth
|
int
|
If repository is remote, the amount of commits to fetch |
100
|
theme
|
str | None
|
Theme to use |
None
|
kwargs
|
Any
|
Optional config values (overrides value from config) |
{}
|
Source code in mkdocs_mknodes/commands/serve.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |