1 | # @microsoft/tsdoc
|
2 |
|
3 | 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.
|
4 |
|
5 |
|
6 | ## What is TSDoc?
|
7 |
|
8 | **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:
|
9 |
|
10 | ```typescript
|
11 | export class Statistics {
|
12 | /**
|
13 | * Returns the average of two numbers.
|
14 | *
|
15 | * @remarks
|
16 | * This method is part of the {@link core-library#Statistics | Statistics subsystem}.
|
17 | *
|
18 | * @param x - The first input number
|
19 | * @param y - The second input number
|
20 | * @returns The arithmetic mean of `x` and `y`
|
21 | *
|
22 | * @beta
|
23 | */
|
24 | public static getAverage(x: number, y: number): number {
|
25 | return (x + y) / 2.0;
|
26 | }
|
27 | }
|
28 | ```
|
29 |
|
30 | ## Give it a try!
|
31 |
|
32 | Check out the [TSDoc Playground](https://microsoft.github.io/tsdoc/) for a cool live demo of our parser!
|
33 |
|
34 |
|
35 | ## API Usage
|
36 |
|
37 | The [api-demo](https://github.com/microsoft/tsdoc/tree/master/api-demo) folder on GitHub illustrates how
|
38 | to invoke the TSDoc parser.
|
39 |
|
40 | A separate NPM package [`@microsoft/tsdoc-config`](https://www.npmjs.com/package/@microsoft/tsdoc)
|
41 | is used for loading the **tsdoc.json** file.
|
42 |
|
43 |
|
44 | ## Get involved
|
45 |
|
46 | The **TSDoc** project is actively evolving. Please visit our GitHub project for the latest documentation, instructions for building/debugging the projects, and other resources:
|
47 |
|
48 | https://github.com/microsoft/tsdoc
|