@rspress/plugin-typedoc
Rspress plugin for integrating TypeDoc and automatically generating API documentation for TypeScript modules.
Installation
Usage
When you start or build the project, the plugin automatically generates an api directory in your docs root. The directory structure is:
The plugin calls TypeDoc internally to generate API documentation for your modules, including module lists, interface details, and function details such as parameters, return values, and descriptions.
Note that the .md documentation files are regenerated every time you start the project to reflect the latest module content. Therefore, we recommend adding the .md files in the api directory to .gitignore, for example docs/api/**/*.md. If you customize the output directory with the outDir parameter below, you should also add the corresponding .md files to .gitignore.
The _meta.json file is only automatically generated on the first run and will not be overwritten afterwards. This means you can manually edit it to customize the sidebar structure (e.g., add dividers, adjust order, etc.) and commit it to git.
Do not modify the generated .md documents in the api directory, because they are overwritten each time the project starts to reflect module content changes.
Options
entryPoints
- Type:
string[] - Default:
[]
Specifies the absolute paths of the TypeScript modules for which documentation should be generated.
outDir
- Type:
string - Default:
api
Customizes the documentation output directory. Provide a relative path, such as api/custom.
setup
- Type:
(app: Application) => Promise<Application> | Promise<void> | void - Default:
() => {}
A function for setting up the TypeDoc application. Use it to customize TypeDoc configuration before documentation is generated.