File tree 4 files changed +39
-10
lines changed
4 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ title: Changelog
7
7
### Features
8
8
9
9
- 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 .
10
11
11
12
### Bug Fixes
12
13
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
65
65
66
66
If the given symbol is unknown, or does not appear in the documentation site,
67
67
the 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.
69
72
70
73
The following plugin will resolve a few types from React to links on the
71
74
official 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.
267
267
}
268
268
}
269
269
```
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<
515
515
) ;
516
516
}
517
517
} 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
+ }
527
533
} else if ( type . refersToTypeParameter ) {
528
534
name = simpleElement (
529
535
< span class = "tsd-signature-type tsd-kind-type-parameter" >
You can’t perform that action at this time.
0 commit comments