Skip to content

Commit b0b8fb5

Browse files
committed
Clarify spec based on conversation from microsoft#205
1 parent 644ea51 commit b0b8fb5

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

tsdoc/src/details/StandardTags.ts

+30-14
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ export class StandardTags {
125125
* separate NPM package.
126126
*
127127
* What gets copied
128-
*
129-
* The `@inheritDoc` tag does not copy the entire comment body. Only the following
128+
*
129+
* The `@inheritDoc` tag does not copy the entire comment body. Only the following
130130
* components are copied:
131131
* - summary section
132132
* - `@remarks` block
133133
* - `@params` blocks
134134
* - `@typeParam` blocks
135135
* - `@returns` block
136-
* Other tags such as `@defaultValue` or `@example` are not copied, and need to be
136+
* Other tags such as `@defaultValue` or `@example` are not copied, and need to be
137137
* explicitly included after the `@inheritDoc` tag.
138138
*
139139
* TODO: The notation for API item references is still being standardized. See this issue:
@@ -331,26 +331,42 @@ export class StandardTags {
331331
/**
332332
* (Extended)
333333
*
334-
* Used to document another symbol or resource that may be related to the current item being documented.
334+
* Used build a list of references to an API item or other resource that may be related to the
335+
* current item.
335336
*
336337
* @remarks
337338
*
338339
* For example:
339340
*
340341
* ```ts
341342
* /**
342-
* * Link to the bar function.
343-
* * @see {@link bar}
343+
* * Parses a string containing a Uniform Resource Locator (URL).
344+
* * @see {@link ParsedUrl} for the returned data structure
345+
* * @see {@link https://tools.ietf.org/html/rfc1738|RFC 1738}
346+
* * for syntax
347+
* * @see your developer SDK for code samples
348+
* * @param url - the string to be parsed
349+
* * @returns the parsed result
344350
* */
345-
* function foo() {}
346-
347-
* // Use the inline {@link} tag to include a link within a free-form description.
348-
* /**
349-
* * @see {@link foo} for further information.
350-
* * @see {@link http://github.com|GitHub}
351-
* */
352-
* function bar() {}
351+
* function parseURL(url: string): ParsedUrl;
352+
* ```
353+
*
354+
* `@see` is a block tag. Each block becomes an item in the list of references. For example, a documentation
355+
* system might render the above blocks as follows:
356+
*
357+
* ```markdown
358+
* `function parseURL(url: string): ParsedUrl;`
359+
*
360+
* Parses a string containing a Uniform Resource Locator (URL).
361+
*
362+
* ## See Also
363+
* - ParsedUrl for the returned data structure
364+
* - RFC 1738 for syntax
365+
* - your developer SDK for code samples
353366
* ```
367+
*
368+
* NOTE: JSDoc attempts to automatically hyperlink the text immediately after `@see`. Because this is ambiguous
369+
* with plain text, TSDoc instead requires an explicit `{@link}` tag to make hyperlinks.
354370
*/
355371
public static readonly see: TSDocTagDefinition = StandardTags._defineTag({
356372
tagName: '@see',

0 commit comments

Comments
 (0)