fix(docs-sync): resolve anchored cross-doc links; fix broken authored links#248
Merged
Conversation
… links docs-sync left a cross-doc link unrewritten whenever its href carried a #fragment: resolveTarget looked the fragment up as part of the path and never matched the source-to-target map, so the raw source-relative href leaked into the generated docs (e.g. vc-blade -> useBlade#banner-management). Strip the #fragment/?query before resolving and re-append it to the rewritten href. Also fix authored links in framework docs that pointed at non-synced targets: - migration/*.md and a .ts source file -> stable GitHub blob URLs - links to internal-only docs (useUserManagement, NotificationTemplate) -> unwrapped to plain text (no public target to resolve to) Adds a links test covering anchored cross-doc resolution.
|
📦 Preview published for commit Install the preview with dist-tag: npm install @vc-shell/framework@pr-248Or pin to the exact commit: npm install @vc-shell/[email protected]Published packages (dist-tag
|
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.
Summary
Fixes cross-doc links in docs-sync and broken authored links in framework docs.
resolveTargetleft a cross-doc link unrewritten whenever its href carried a#fragment: the fragment was looked up as part of the path and never matched the source-to-target map, so the raw source-relative href leaked into the generated docs (e.g.vc-blade->useBlade#banner-management). Now strips the#fragment/?querybefore resolving and re-appends it to the rewritten href.migration/*.mdand a.tssource file -> stable GitHub blob URLsuseUserManagement,NotificationTemplate) -> unwrapped to plain text (no public target to resolve to)Test plan
cli/docs-synclink transformer tests pass, including the new anchored cross-doc case.