Skip to content

Getting Started

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

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

Installation

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

    Terminal window
    npm i starlight-typedoc typedoc typedoc-plugin-markdown
  2. Configure the plugin in 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',
    }),
    ],
    })
  3. Start the development server to preview the generated documentation.

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