serve
Class info¶
🛈 DocStrings¶
_serve
¶
_serve(
config_file: str | None | YAMLInput = None,
livereload: bool = True,
build_type: Literal["clean", "dirty"] | None = None,
watch_theme: bool = False,
watch: list[str] | None = None,
**kwargs: Any
) -> None
Start the MkDocs development server.
By default it will serve the documentation on http://localhost:8000/ and it will rebuild the documentation and refresh the page automatically whenever a file is edited.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_file
|
str | None | YAMLInput
|
Config file to use |
None
|
livereload
|
bool
|
Reload on file changes |
True
|
build_type
|
Literal['clean', 'dirty'] | None
|
Type of the build |
None
|
watch_theme
|
bool
|
Whether to watch the theme for file changes |
False
|
watch
|
list[str] | None
|
Additional files / folders to watch |
None
|
kwargs
|
Any
|
Additional config values. Overrides values from config_file |
{}
|
Source code in mkdocs_mknodes/commands/serve.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
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
51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
serve
¶
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
|
Path to the repository a page should be built for |
required | |
build_fn
|
Callable to use for creating the webpage |
required | |
clone_depth
|
If repository is remote, the amount of commits to fetch |
required | |
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 |
|