buildcollector
Class info¶
Classes¶
Name | Children | Inherits |
---|---|---|
BuildCollector mkdocs_mknodes.buildcollector A class to assist in extracting build stuff from a Node tree + Theme. |
🛈 DocStrings¶
Module containing the BuildCollector class.
BuildCollector
¶
A class to assist in extracting build stuff from a Node tree + Theme.
Source code in mkdocs_mknodes/buildcollector.py
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 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
__init__
¶
__init__(
backends: list[BuildBackend],
show_page_info: bool = False,
global_resources: bool = True,
render_by_default: bool = True,
)
Constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
backends
|
list[BuildBackend]
|
A list of backends which should be used for building |
required |
show_page_info
|
bool
|
Add a admonition box containing page build info to each page |
False
|
global_resources
|
bool
|
If False, make page resources non-global by moving them to the page template blocks |
True
|
render_by_default
|
bool
|
Whether to resolve all MkPages with their environment |
True
|
Source code in mkdocs_mknodes/buildcollector.py
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 |
|
collect
¶
collect(root: MkNode, theme: Theme)
Collect build stuff from given node + theme.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
root
|
MkNode
|
A node to collect build stuff from |
required |
theme
|
Theme
|
A theme to collect build stuff from. |
required |
Source code in mkdocs_mknodes/buildcollector.py
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 226 227 228 229 |
|
collect_nav
¶
collect_nav(nav: MkNav)
Preprocess nav and collect its data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nav
|
MkNav
|
Nav to collect the data from. |
required |
Source code in mkdocs_mknodes/buildcollector.py
266 267 268 269 270 271 272 273 274 275 276 277 278 |
|
collect_page
¶
collect_page(page: MkPage)
Preprocess page and collect its data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
MkPage
|
Page to collect the data from. |
required |
Source code in mkdocs_mknodes/buildcollector.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
render_nav
¶
render_nav(nav: MkNav)
Convert a nav to markdown/HTML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nav
|
MkNav
|
Nav to render. |
required |
Source code in mkdocs_mknodes/buildcollector.py
280 281 282 283 284 285 286 287 288 |
|
render_page
¶
render_page(page: MkPage)
Convert a page to markdown/HTML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
MkPage
|
Page to render. |
required |
Source code in mkdocs_mknodes/buildcollector.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
|
add_page_info
¶
add_page_info(page: MkPage, req: Resources)
Add a collapsed admonition box showing some page-related data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
MkPage
|
Page which should get updated. |
required |
req
|
Resources
|
Resources of the page (passed in to avoid having to collect them again) |
required |
Source code in mkdocs_mknodes/buildcollector.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
process_resources
¶
process_resources(page: MkPage) -> Resources
Add resources from page to its template and return the "filtered" resources.
Source code in mkdocs_mknodes/buildcollector.py
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 |
|
update_nav_template
¶
update_nav_template(nav: MkNav)
Set template filename, metadata reference and extends
path for given nav.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nav
|
MkNav
|
Nav of the template |
required |
Source code in mkdocs_mknodes/buildcollector.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
update_page_template
¶
update_page_template(page: MkPage)
Set template filename, metadata reference and extends
path for given page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page
|
MkPage
|
Page of the template |
required |
Source code in mkdocs_mknodes/buildcollector.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|