Beautiful API docs from TypeScript source. Zero effort.
Generate fully structured, always-accurate API documentation for your Docusaurus site directly from TypeScript source code. Every page stays in sync with your code automatically.
npm install @docsgen/core @docsgen/docusaurusimport plugin from "@docsgen/docusaurus";
const config = {
plugins: [
[
"@docsgen/docusaurus",
{
id: "api",
outDir: "docs/api",
packages: [
{
title: "my-library",
dir: "../packages/my-library",
entryPath: "src/index.ts",
},
],
},
],
],
};npm run buildThat's it. Structured MDX pages for every class, function, type, and enum appear in docs/api/, organized by category
and always matching your source.
- Always accurate - Pages regenerate on every build from your TypeScript source. Change a type, rename a method, add a parameter: the docs update automatically.
- Structured output - Classes, functions, types, enums, and variables each get dedicated pages with parameters, return types, method tables, signatures, and examples.
- Embed API in guides - Use the
@importdirective to embed live API fragments (method tables, parameter lists, type definitions) inside hand-written MDX. They never go stale. - Monorepo ready - Generate docs for multiple packages in a single Docusaurus site with per-package configuration, separate entry points, and optional index pages.
- Fully customizable - Override page templates per kind, control which sections render, remap file names, filter symbols, and reorder categories.
- Built on TypeDoc - Leverages TypeDoc for parsing with full support for JSDoc tags, generics, and complex type hierarchies.
| Package | Version | Downloads |
|---|---|---|
| @docsgen/core | ||
| @docsgen/docusaurus |
docs/api/
my-library/
index.mdx
Classes/
MyClass.mdx
Functions/
myFunction.mdx
Types/
MyType.mdx
Enums/
MyEnum.mdx
Add the importer remark plugin to your Docusaurus config:
import { importer } from "@docsgen/core";
const config = {
presets: [
[
"classic",
{
docs: {
remarkPlugins: [
importer({
packageRoute: "api",
apiDir: "docs/api",
}),
],
},
},
],
],
};Then use @import directives in any MDX file:
(@import my-library MyClass type=methods&display=table)
(@import my-library createClient type=parameters&display=table)
(@import my-library MyClass type=properties&display=grid)This renders live, always-up-to-date API fragments directly in your hand-written documentation.
Sponsoring is an important part of docsgen's growth. We strongly encourage you to help us maintain the project and shape its future.
- Star our GitHub repo
- Create pull requests, submit bugs, suggest new features or documentation updates
- Spread the word
We welcome contributions of all kinds. Check the Contributing Guide, fork the repository, make your changes, and send a pull request. We will be glad to consider your suggestions.
If you have questions, start a new discussion thread on the docsgen GitHub. For direct inquiries, reach out via email (listed on our profiles).