Skip to content

Getting Started

A Starlight plugin using TypeDoc and typedoc-plugin-markdown to generate documentation from TypeScript code.

Check out the example for a preview of the generated documentation.

Some TSDoc tags uses a custom Markdown syntax, e.g. the @deprecated, @alpha, @beta and @experimental tags using Starlight asides:

Screenshot of a deprecated tag in Starlight

Install the plugin

Starlight TypeDoc is a Starlight plugin. Install it and its peer dependencies using your favorite package manager:

Terminal window
npm install starlight-typedoc typedoc typedoc-plugin-markdown@next

Add the plugin

The Starlight TypeDoc plugin can be added to your Starlight configuration in the astro.config.mjs file:

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: [
// Generate the documentation.
starlightTypeDoc({
entryPoints: ['../path/to/entry-point.ts'],
tsconfig: '../path/to/tsconfig.json',
}),
],
sidebar: [
{
label: 'Guides',
items: [{ label: 'Example Guide', link: '/guides/example/' }],
},
// Add the generated sidebar group to the sidebar.
typeDocSidebarGroup,
],
title: 'My Docs',
}),
],
})

The Starlight TypeDoc plugin behavior can be tweaked using various configuration options.