Use absolute guide links in inline comments #87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ocavue/fix-part-link"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PRs changes some links in comments from relative style (e.g.
/docs/guide/#doc) to absolute style (e.g.https://prosemirror.net/docs/guide/#doc). While both styles of links work fine in the documentation site https://prosemirror.net/, in users' IDE, absolute links work better.Before:
After:
An alternative way to implement this is adding a new option to
@marijn/buildtool, like the existingexpandLinkoption but it feels overkill.Where are you getting the .d.ts file that these comments come from? Because the ones on npm should all have these links expanded as part of the build process (and the raw source files use triple-slash comments, which, as far as I know, TypeScript won't pick up anyway).
https://unpkg.com/prosemirror-model@1.24.1/dist/index.d.ts
In the TypeScript source code, comments like
[text](#model.MarkSpec.parseDOM)(shown in blue box above) will get processed, which make up the majority. However, comments like[text](/docs/guide/#schema.content_expressions)(shown in red box above) won't.The build process that handles these links can be found below. Notice that only links that start with
#get handled.github.com/marijnh/buildtool@2c5a01026f/src/buildtool.ts (L127)github.com/ProseMirror/buildhelper@593eda9b20/bin/pm-buildhelper.js (L15)Ahh right, these are links via the website root, not anchors. I'd say the build process could handle those too. Done in attached patch.
Pull request closed