Skip to content

mkdocstrings-typescriptΒ€

documentation gitpod gitter

A Typescript handler for mkdocstrings.

Still in prototyping phase!

Feedback is welcome.

InstallationΒ€

This project is available to sponsors only, through my Insiders program. See Insiders explanation and installation instructions.

UsageΒ€

Add these TypeDoc configuration files to your repository:

πŸ“ ./
β”œβ”€β”€ πŸ“ src/
β”‚   └── πŸ“ package1/
β”œβ”€β”€  typedoc.base.json
└──  typedoc.json
typedoc.base.json
{
  "$schema": "https://typedoc.org/schema.json",
  "includeVersion": true
}
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.

Then in each of your package, add this TypeDoc configuration file:

πŸ“ ./
β”œβ”€β”€ πŸ“ src/
β”‚   └── πŸ“ package1/
β”‚       └──  typedoc.json
β”œβ”€β”€  typedoc.base.json
└──  typedoc.json
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.

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:

::: @owner/packageName
    handler: typescript