Skip to content

Configuration

The Starlight TypeDoc plugin can be configured inside the astro.config.mjs configuration file of your project:

astro.config.mjs
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

You can pass the following options to the Starlight TypeDoc plugin.

entryPoints (required)

Type: string[]

The path(s) to the entry point(s) to document.

tsconfig (required)

Type: string

The path to the tsconfig.json file to use for the documentation generation.

output

Type: string
Default: 'api'

The output directory containing the generated documentation markdown files relative to the src/content/docs/ directory.

pagination

Type: boolean
Default: false

Whether the footer should include previous and next page links for the generated documentation.

Type: StarlightTypeDocSidebarOptions

The generated documentation sidebar configuration.

typeDoc

Type: TypeDocConfig

Additional TypeDoc or typedoc-plugin-markdown configuration to override the default settings used by the plugin.

watch

Type: boolean
Default: false

Whether to watch the entry point(s) for changes and regenerate the documentation when needed.

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.

The sidebar configuration is an object with the following properties:

collapsed

Type: boolean
Default: false

Wheter the generated documentation sidebar group should be collapsed by default. Note that nested sidebar groups are always collapsed.

label

Type: string
Default: 'API'

The generated documentation sidebar group label.