Commit e3aa0d4
Add support for partial nav inclusion using anchor syntax
This commit adds the ability to include only specific sections of a
navigation tree from an included mkdocs.yml file using anchor syntax.
Syntax: !include path/to/mkdocs.yml#SectionName
Changes:
- Parse anchor fragments from include paths (e.g., #Guides)
- Extract only the specified nav section from the included file
- Generate unique aliases by appending section names to avoid conflicts
- Update path resolution to handle anchored includes correctly
Example usage:
nav:
- Guides:
- My Section: "!include docs/other/mkdocs.yml#Guides"
This allows for more flexible documentation organization by reusing
specific sections of navigation trees without duplicating content or
including entire documentation hierarchies.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent f62ae22 commit e3aa0d4
1 file changed
Lines changed: 39 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | | - | |
| 79 | + | |
78 | 80 | | |
79 | | - | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
175 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
| |||
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
288 | 300 | | |
289 | 301 | | |
290 | 302 | | |
291 | | - | |
| 303 | + | |
292 | 304 | | |
293 | 305 | | |
294 | 306 | | |
295 | 307 | | |
296 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
297 | 331 | | |
298 | 332 | | |
299 | 333 | | |
| |||
0 commit comments