fix: dead link for packages with only private submodules#44
Merged
Conversation
…dules 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>
This was referenced Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while auditing Prefect's regenerated docs for dead links (follow-up to #42, #43).
A package whose only submodules are private (e.g.
prefect.cli.deploy, whose children are all_-prefixed) is rendered as a leaf in the nav tree, but the generator writes it as a…-__init__.mdxpage because those private submodules exist on disk. Navigation emitted the bare leaf path → 404.The leaf branch now points at whichever file was actually written (prefers the plain page, falls back to
-__init__when only that exists; falls back to the plain name when neither exists, preserving unit-test behavior).Verified: regenerating Prefect's full SDK reference with this build yields 0 dead links and 0 orphans across all 360 nav entries.
🤖 Generated with Claude Code