https://github.com/mkdocstrings/typescript
A TypeScript handler for mkdocstrings. Available to sponsors only.
https://github.com/mkdocstrings/typescript
mkdocs mkdocstrings mkdocstrings-handler typescript
Last synced: about 2 months ago
JSON representation
A TypeScript handler for mkdocstrings. Available to sponsors only.
- Host: GitHub
- URL: https://github.com/mkdocstrings/typescript
- Owner: mkdocstrings
- License: isc
- Created: 2023-11-17T14:14:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-04T13:42:55.000Z (over 1 year ago)
- Last Synced: 2025-01-30T16:43:46.702Z (11 months ago)
- Topics: mkdocs, mkdocstrings, mkdocstrings-handler, typescript
- Language: Python
- Homepage: https://mkdocstrings.github.io/typescript
- Size: 456 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# mkdocstrings-typescript
[](https://github.com/mkdocstrings/typescript/actions?query=workflow%3Aci)
[](https://mkdocstrings.github.io/typescript/)
[](https://pypi.org/project/mkdocstrings-typescript/)
[](https://app.gitter.im/#/room/#typescript:gitter.im)
A Typescript handler for mkdocstrings.
WARNING: **Still in prototyping phase!**
Feedback is welcome.
## Installation
```bash
pip install mkdocstrings-typescript
```
## Usage
Add these [TypeDoc](https://typedoc.org/) configuration files to your repository:
```tree hl_lines="4 5"
./
src/
package1/
typedoc.base.json
typedoc.json
```
```json title="typedoc.base.json"
{
"$schema": "https://typedoc.org/schema.json",
"includeVersion": true
}
```
```json title="typedoc.json"
{
"extends": ["./typedoc.base.json"],
"entryPointStrategy": "packages",
"entryPoints": ["./src/*"]
}
```
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/).
Then in each of your package, add this TypeDoc configuration file:
```tree hl_lines="4"
./
src/
package1/
typedoc.json
typedoc.base.json
typedoc.json
```
```json title="typedoc.json"
{
"extends": ["../../typedoc.base.json"],
"entryPointStrategy": "expand",
"entryPoints": ["src/index.d.ts"]
}
```
Again, update entrypoints to match your file and package layout. See [TypeDoc's configuration documentation](https://typedoc.org/options/configuration/).
**Your packages must be built for TypeDoc to work.**
You are now able to use the TypeScript handler to inject API docs in your Markdown pages by referencing package names:
```md
::: @owner/packageName
handler: typescript
```
You can set the Typescript handler as default handler:
```yaml
plugins:
- mkdocstrings:
default_handler: typescript
```
By setting it as default handler you can omit it when injecting documentation:
```md
::: @owner/packageName
```