File tree Expand file tree Collapse file tree 4 files changed +39
-10
lines changed Expand file tree Collapse file tree 4 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ title: Changelog
77### Features
88
99- The ` --favicon ` option may now be given a link starting with ` https?:// ` instead of a path, #2851 .
10+ - TypeDoc now supports specifying ` # ` as the link in ` externalSymbolLinkMappings ` to indicate the type should not be linked to, #2853 .
1011
1112### Bug Fixes
1213
Original file line number Diff line number Diff line change @@ -65,7 +65,10 @@ Plugins can add support for linking to third party sites by calling
6565
6666If the given symbol is unknown, or does not appear in the documentation site,
6767the resolver may return ` undefined ` and no link will be rendered unless provided
68- by another resolver.
68+ by another resolver. The string ` "#" ` may also be returned to indicate that
69+ TypeDoc should mark the symbol as externally resolved, but not produce a link
70+ to it. This can be useful if you want to keep the link for usage in VSCode,
71+ but not include it in the documentation.
6972
7073The following plugin will resolve a few types from React to links on the
7174official React documentation site.
Original file line number Diff line number Diff line change @@ -267,3 +267,22 @@ the special `global` package reserved for global types.
267267 }
268268}
269269```
270+
271+ The string ` "#" ` may also be specified to indicate to TypeDoc that the type should be marked as resolved
272+ but no link should be created.
273+
274+ ``` json
275+ // typedoc.json
276+ {
277+ "externalSymbolLinkMappings" : {
278+ // used by {@link !Promise }
279+ "global" : {
280+ "Promise" : " #"
281+ },
282+ // used by type Foo = Promise<string>
283+ "typescript" : {
284+ "Promise" : " #"
285+ }
286+ }
287+ }
288+ ```
Original file line number Diff line number Diff line change @@ -515,15 +515,21 @@ const typeBuilder: TypeVisitor<
515515 ) ;
516516 }
517517 } else if ( type . externalUrl ) {
518- name = simpleElement (
519- < a
520- href = { type . externalUrl }
521- class = "tsd-signature-type external"
522- target = "_blank"
523- >
524- { type . name }
525- </ a > ,
526- ) ;
518+ if ( type . externalUrl === "#" ) {
519+ name = simpleElement (
520+ < span class = "tsd-signature-type external" > { type . name } </ span > ,
521+ ) ;
522+ } else {
523+ name = simpleElement (
524+ < a
525+ href = { type . externalUrl }
526+ class = "tsd-signature-type external"
527+ target = "_blank"
528+ >
529+ { type . name }
530+ </ a > ,
531+ ) ;
532+ }
527533 } else if ( type . refersToTypeParameter ) {
528534 name = simpleElement (
529535 < span class = "tsd-signature-type tsd-kind-type-parameter" >
You can’t perform that action at this time.
0 commit comments