You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Bar.baz link is shortened to just baz in the output, which is less informative when linking to another class. It would be nice if there was an option to allow {@link} tags to keep the full name in output.
exportclassMyPlugin{initialize(app: Application){// retain full link namesapp.converter.on(Converter.EVENT_RESOLVE_END,(context: Context)=>{constproject=context.project;for(constreflectionofObject.values(project.reflections)){if(reflection.comment){MyPlugin.expandLinks(reflection.comment,reflection);}}});}/** * Save full friendly name as tsLinkText so we can retain full name links. * This prevents links like "Foo.bar" from rendering as just "bar". * Only applies to links that include "." or "#", not local links. * Does not apply to links including "|", which indicates another name is supplied. * @param comment * @param reflection */staticexpandLinks(comment: Comment,reflection: Reflection){functionmapParts(parts: CommentDisplayPart[]){returnparts.flatMap((part)=>{if(part.kind==="inline-tag"&&(part.tag==="@link"||part.tag==="@linkcode"||part.tag==="@linkplain")&&(part.text.includes('.')||part.text.includes('#'))&&!part.text.includes('|')&&part.targetinstanceofReflectionSymbolId){consttsTarget=reflection.project.getReflectionFromSymbolId(part.target);if(tsTarget)part.tsLinkText=tsTarget.getFriendlyFullName();}returnpart;});}comment.summary=mapParts(comment.summary);for(consttagofcomment.blockTags){tag.content=mapParts(tag.content);}}}
This assumes the links are well-formed and useTsLinkResolution is being used.
Search Terms
link
Problem
We have many links in our documentation, some which link to members on the same page, others which link to other pages.
{@link foo}
{@link Bar.baz}
Currently, the Bar.baz link is shortened to just baz in the output, which is less informative when linking to another class. It would be nice if there was an option to allow {@link} tags to keep the full name in output.
This also doesn't appear to be easy to change with a plugin since the
InlineDisplayTag.text
is set in https://github.com/TypeStrong/typedoc/blob/master/src/lib/converter/comments/linkResolver.ts. That means it's hard to determine the original link text if you wanted to get the full name from theInlineDisplayTag.target
.Maybe it could be done with a plugin that appended a '|' to all links including '.'? Massaging input like that doesn't seem great though.
Suggested Solution
Add an option, maybe 'fullNameLinks', that keeps the full name if the @link tag includes '.' or '#'.
The text was updated successfully, but these errors were encountered: