Skip to content

BetterTyped/docsgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

78 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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.

Documentation | Quick Start | Guides

npm npm license


Quick Start

1. Install

npm install @docsgen/core @docsgen/docusaurus

2. Add the plugin

import 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",
          },
        ],
      },
    ],
  ],
};

3. Build

npm run build

That's it. Structured MDX pages for every class, function, type, and enum appear in docs/api/, organized by category and always matching your source.

Why docsgen?

  • 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 @import directive 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.

Packages

Package Version Downloads
@docsgen/core npm downloads
@docsgen/docusaurus npm downloads

Examples

Generated output structure

docs/api/
  my-library/
    index.mdx
    Classes/
      MyClass.mdx
    Functions/
      myFunction.mdx
    Types/
      MyType.mdx
    Enums/
      MyEnum.mdx

Embed API fragments in guides

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.

Documentation


Help us keep working on this project

Sponsoring is an important part of docsgen's growth. We strongly encourage you to help us maintain the project and shape its future.

How can I support the developers?

  • Star our GitHub repo
  • Create pull requests, submit bugs, suggest new features or documentation updates
  • Spread the word

Contributing

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.

License

Apache-2.0

Contact

If you have questions, start a new discussion thread on the docsgen GitHub. For direct inquiries, reach out via email (listed on our profiles).

About

πŸ“– Documentation generator based on typedoc and react components. Automate your process completely or inject partial generated data into your md docs pages, so you never have to think about updating properties, parameters, methods or any other changing part of it. Just read it from your code!

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages