microsoft / tsdoc

A doc comment standard for TypeScript
https://tsdoc.org/
MIT License
4.74k stars 131 forks source link

Support tables in TSDoc comments #421

Open Josmithr opened 2 months ago

Josmithr commented 2 months ago

It is frequently useful to break information down into table form. This feature request is not attempting to prescribe a syntax, but using Markdown syntax as an example, it would be VERY nice to be able to write a comment like the following:

/**
 * Foo
 *
 * @remarks
 * 
 * | Foo | Bar | Baz |
 * | --- | --- | --- |
 * | 1 | 2 | 3 |
 */
export interface Foo { }

And have related tooling (VSCode intellisense, API-Extractor, etc.) correctly recognize the syntax and display the contents as a table. Note that being able to use other TSDoc tags / syntax within the table is also desired. E.g. being able to leverage {@link } tags within the table.

This could be solved via #12, but that issue has been open for 6 years now, so a smaller / scoped feature request seems appropriate.

CraigMacomber commented 2 months ago

And have related tooling (VSCode intellisense, API-Extractor, etc.) correctly recognize the syntax and display the contents as a table.

The included example works fine in VSCode IntelliSense already including if there are links within the cells, and is valid markdown, so I think picking that format would make sense.