fix: strip broken links from generated API docs#602
Open
akudev wants to merge 5 commits into
Open
Conversation
Address 2,235 broken links (1.46% of all local links) found by the link checker. The problems are systematic TypeDoc artifacts: - Remove cross-library module augmentation blocks in preprocessing so TypeDoc generates content in the canonical library (e.g. sap/tnt/library in sap.tnt, not sap.f) — fixes 40 broken links - Strip <a> tags pointing to ClassInfo type alias (no useful page) — 1,677 - Strip links to jQuery/QUnit types (correctly excluded pages) — ~265 - Strip links to pseudo-types int/float (UI5 aliases for number) — 93 - Strip links with nested namespaces/ segments (dead TypeDoc paths) — ~50 - Remove TypeDoc 'References' section from library READMEs — ~88 - Prune README list entries whose target page was not generated — ~38
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the API docs generation pipeline to remove or rewrite systematic TypeDoc-generated link targets that are known to be dead, reducing broken-link noise in the published HTML output.
Changes:
- Preprocess
.d.tsinputs to remove cross-library module augmentation blocks so TypeDoc generates content in the canonical library. - Post-process rendered HTML to strip anchors that point to known-dead TypeDoc targets (e.g.
ClassInfo, jQuery/QUnit,int/float, nested namespaces) and to remove the “References” section. - Post-process output to prune README list entries whose targets were not generated.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/generate-api-docs/generate.mjs | Adds .d.ts augmentation stripping and multiple HTML/README post-processing steps to eliminate broken links in generated API docs. |
| .changeset/fix-apidoc-broken-links.md | Adds an empty changeset to satisfy required checks without bumping packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Guard against missing opening brace in augmentation removal (indexOf returning -1 would corrupt the file) - Fix References section regex: htmlFixed is raw content before template wrapping, so <footer> lookahead never matched; strip to end of string
- namespaces/JQuery[./] matches both .html and /subpath variants - Add interfaces/JQuery, /JQueryStatic, JQueryPromise patterns to strip links to pages excluded by EXCLUDE_PATTERNS - namespaces/QUnit[./] covers QUnit.html as well as subpages
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.
Address 2,235 broken links (1.46% of all local links) found by the link checker. The problems are systematic TypeDoc artifacts: