Utils & Themes
Quick Start

Quick Start

Install and Setup VitePress

Please follow instructions at https://vitepress.dev/guide/getting-started.

Install TypeDoc and plugins

TypeDoc would typically be installed and executed from the VitePress project root but can be installed in any location.

npm install typedoc typedoc-plugin-markdown typedoc-vitepress-theme --save-dev

Update the TypeDoc config

Update the TypeDoc config file to include the plugins and add any additional options.

typedoc.json
{
  "plugin": ["typedoc-plugin-markdown", "typedoc-vitepress-theme"]
}

Run TypeDoc before bootstrapping VitePress

Run TypeDoc before bootstraping VitePress.

package.json
"predocs": "typedoc"
"docs:dev": "vitepress dev",
"docs:build": "vitepress build"

Configure Navbar and Sidebar

⚠️

If running TypeDoc from outside the VitePress project root then the option docsRoot will need to be be updated for sidebar links to resolve correctly.

A sidebar named typedoc-sidebar.json is auto-generated to the output directory. This can then be referenced in the config file to include the sidebar in the docs.

.vitepress/config.mts
import typedocSidebar from '../api/typedoc-sidebar.json';
 
module.exports = {
  themeConfig: {
    nav: [{ text: 'API', link: '/api/' }],
    sidebar: [
      {
        text: 'API',
        items: typedocSidebar,
      },
    ],
  },
};

For further documentation please visit https://vitepress.dev/reference/default-theme-sidebar.