TypeDoc Markdown Plugin

4.11.0 · active · verified Wed Apr 22

typedoc-plugin-markdown is a TypeDoc plugin that converts TypeScript API documentation into Markdown, making it compatible with static site generators like Docusaurus, VitePress, or GitHub Wikis. The current stable version, 4.11.0, reflects an active development approach with frequent minor and patch releases, ensuring ongoing enhancements and bug fixes. Its core function is to replace TypeDoc's default HTML theme with a built-in Markdown theme, offering extensive configuration options for various Markdown dialects and output structures. This plugin differentiates itself by providing fine-grained control over markdown generation, including custom routers for file organization, support for Prettier formatting, and options for dynamic content like navigation JSON. It is an essential tool for projects requiring documentation in a portable, text-based format.

Common errors

Warnings

Install

Imports

Quickstart

Installs TypeDoc and the markdown plugin, configures TypeDoc via `typedoc.json` to process a sample TypeScript file, and generates Markdown API documentation into a specified output directory.

npm install typedoc@0.28.x typedoc-plugin-markdown --save-dev

// src/index.ts (example TypeScript file)
/**
 * Represents a user profile.
 * @interface
 */
export interface UserProfile {
  /** The unique identifier for the user. */
  id: string;
  /** The user's full name. */
  name: string;
  /** The user's email address. */
  email?: string;
  /**
   * Greets the user.
   * @param greeting Custom greeting message.
   * @returns A personalized greeting string.
   */
  greet(greeting: string): string;
}

/**
 * A utility class for user operations.
 */
export class UserUtilities {
  /**
   * Creates a new user profile.
   * @param id The user ID.
   * @param name The user name.
   * @returns A new UserProfile instance.
   */
  static createProfile(id: string, name: string): UserProfile {
    return {
      id,
      name,
      greet: (greeting: string) => `${greeting}, ${name}!`,
    };
  }
}

// typedoc.json
{
  "entryPoints": [
    "src/index.ts"
  ],
  "out": "docs/api",
  "plugin": [
    "typedoc-plugin-markdown"
  ],
  "entryDocument": "index.md",
  "excludePrivate": true,
  "excludeProtected": true,
  "hideInPageTOC": true,
  "outputFileStrategy": "modules"
}

# Run TypeDoc from your project root
npx typedoc

view raw JSON →