Configuration
The Starlight TypeDoc plugin can be configured inside the astro.config.mjs configuration file of your project:
import starlight from '@astrojs/starlight'import { defineConfig } from 'astro/config'import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc'
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightTypeDoc({ // Configuration options go here. }), ], title: 'My Docs', }), ],})Configuration options
Section titled “Configuration options”You can pass the following options to the Starlight TypeDoc plugin.
entryPoints (required)
Section titled “entryPoints (required)”Type: string[]
The path(s) to the entry point(s) to document.
tsconfig (required)
Section titled “tsconfig (required)”Type: string
The path to the tsconfig.json file to use for the documentation generation.
output
Section titled “output”Type: string
Default: 'api'
The output directory containing the generated documentation markdown files relative to the src/content/docs/ directory.
pagination
Section titled “pagination”Type: boolean
Default: false
Whether the footer should include previous and next page links for the generated documentation.
sidebar
Section titled “sidebar”Type: StarlightTypeDocSidebarOptions
The generated documentation sidebar configuration.
typeDoc
Section titled “typeDoc”Type: TypeDocConfig
Additional TypeDoc or typedoc-plugin-markdown configuration to override the default settings used by the plugin.
Type: boolean
Default: false
Whether to watch the entry point(s) for changes and regenerate the documentation when needed.
errorOnEmptyDocumentation
Section titled “errorOnEmptyDocumentation”Type: boolean
Default: true
Whether the plugin should error when no TypeDoc documentation is generated.
By default, the plugin will error when no TypeDoc documentation is generated.
Setting this option to false will prevent the plugin from erroring in this case.
This can be useful when generating documentation for multiple entry points and only some of them contain documented code at a given time.
Sidebar configuration
Section titled “Sidebar configuration”The sidebar configuration is an object with the following properties:
collapsed
Section titled “collapsed”Type: boolean
Default: false
Wheter the generated documentation sidebar group should be collapsed by default. Note that nested sidebar groups are always collapsed.
Type: string
Default: 'API'
The generated documentation sidebar group label.