Skip to content

Commit f296902

Browse files
committed
docs: Add usage notes in readme
1 parent f55e36a commit f296902

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,62 @@ Feedback is welcome.
1414
This project is available to sponsors only, through my Insiders program.
1515
See Insiders [explanation](https://mkdocstrings.github.io/typescript/insiders/)
1616
and [installation instructions](https://mkdocstrings.github.io/typescript/insiders/installation/).
17+
18+
## Usage
19+
20+
Add these [TypeDoc](https://typedoc.org/) configuration files to your repository:
21+
22+
```tree hl_lines="4 5"
23+
./
24+
src/
25+
package1/
26+
typedoc.base.json
27+
typedoc.json
28+
```
29+
30+
```json title="typedoc.base.json"
31+
{
32+
"$schema": "https://typedoc.org/schema.json",
33+
"includeVersion": true
34+
}
35+
```
36+
37+
```json title="typedoc.json"
38+
{
39+
"extends": ["./typedoc.base.json"],
40+
"entryPointStrategy": "packages",
41+
"entryPoints": ["./src/*"]
42+
}
43+
```
44+
45+
Update the entrypoints to match your file layout so that TypeDoc can find your packages. See [TypeDoc's configuration documentation](https://typedoc.org/options/configuration/).
46+
47+
Then in each of your package, add this TypeDoc configuration file:
48+
49+
```tree hl_lines="4"
50+
./
51+
src/
52+
package1/
53+
typedoc.json
54+
typedoc.base.json
55+
typedoc.json
56+
```
57+
58+
```json title="typedoc.json"
59+
{
60+
"extends": ["../../typedoc.base.json"],
61+
"entryPointStrategy": "expand",
62+
"entryPoints": ["src/index.d.ts"]
63+
}
64+
```
65+
66+
Again, update entrypoints to match your file and package layout. See [TypeDoc's configuration documentation](https://typedoc.org/options/configuration/).
67+
68+
**Your packages must be built for TypeDoc to work.**
69+
70+
You are now able to use the TypeScript handler to inject API docs in your Markdown pages by referencing package names:
71+
72+
```python
73+
::: @owner/packageName
74+
handler: typescript
75+
```

0 commit comments

Comments
 (0)