Skip to content

fix: strip broken links from generated API docs#602

Open
akudev wants to merge 5 commits into
mainfrom
fix/apidoc
Open

fix: strip broken links from generated API docs#602
akudev wants to merge 5 commits into
mainfrom
fix/apidoc

Conversation

@akudev

@akudev akudev commented Jun 17, 2026

Copy link
Copy Markdown
Member

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 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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts inputs 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.

Comment thread scripts/generate-api-docs/generate.mjs
Comment thread scripts/generate-api-docs/generate.mjs Outdated
- 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread scripts/generate-api-docs/generate.mjs
akudev added 3 commits June 17, 2026 13:30
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants