1 | # @microsoft/tsdoc
|
2 |
|
3 | <div>
|
4 | <br />
|
5 | <a href="https://tsdoc.org/">
|
6 | <img width="200" src="https://tsdoc.org/images/tsdoc.svg">
|
7 | </a>
|
8 | <p />
|
9 | </div>
|
10 |
|
11 | This library is the reference implementation of a parser for the TSDoc syntax. Using this library is an easy way to ensure that your tool is 100% compatible with the standard.
|
12 |
|
13 |
|
14 | ## What is TSDoc?
|
15 |
|
16 | **TSDoc** is a proposal to standardize the doc comments used in [TypeScript](http://www.typescriptlang.org/) source files. It allows different tools to extract content from comments without getting confused by each other's syntax. The **TSDoc** notation looks pretty familiar:
|
17 |
|
18 | ```typescript
|
19 | export class Statistics {
|
20 | /**
|
21 | * Returns the average of two numbers.
|
22 | *
|
23 | * @remarks
|
24 | * This method is part of the {@link core-library#Statistics | Statistics subsystem}.
|
25 | *
|
26 | * @param x - The first input number
|
27 | * @param y - The second input number
|
28 | * @returns The arithmetic mean of `x` and `y`
|
29 | *
|
30 | * @beta
|
31 | */
|
32 | public static getAverage(x: number, y: number): number {
|
33 | return (x + y) / 2.0;
|
34 | }
|
35 | }
|
36 | ```
|
37 |
|
38 | ## Give it a try!
|
39 |
|
40 | Check out the [TSDoc Playground](https://tsdoc.org/play) for a cool live demo of our parser!
|
41 |
|
42 |
|
43 | ## API Usage
|
44 |
|
45 | The [api-demo](https://github.com/microsoft/tsdoc/tree/main/api-demo) folder on GitHub illustrates how
|
46 | to invoke the TSDoc parser.
|
47 |
|
48 | A separate NPM package [`@microsoft/tsdoc-config`](https://www.npmjs.com/package/@microsoft/tsdoc-config)
|
49 | is used for loading the **tsdoc.json** file.
|
50 |
|
51 |
|
52 | ## Get involved
|
53 |
|
54 | The **TSDoc** project is actively evolving. Please visit the website for the latest documentation, instructions for building/debugging the projects, and other resources:
|
55 |
|
56 | https://tsdoc.org/
|