Repository navigation
Commit c086cd0
fix: point nav at -__init__ page for packages with only private submodules (#44)
A package whose only submodules are private/internal is rendered as a leaf
in the navigation tree (its children aren't in generated_modules), but the
generator writes it as an "-__init__" page because those private submodules
exist on disk. Navigation then emitted the bare leaf path, producing a dead
link (e.g. prefect-cli-deploy in nav vs prefect-cli-deploy-__init__.mdx on
disk).
The leaf branch now points at whichever file was actually written: if the
plain page is absent but the -__init__ variant exists, use the latter. When
neither exists (e.g. pure unit tests with no files on disk) it falls back to
the plain name, preserving existing behavior.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 527b129 commit c086cd0
2 files changed
Lines changed: 44 additions & 2 deletions
File tree
- src/mdxify
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
0 commit comments