TypeDoc requires Node.js to run. It supports the current LTS version or newer. It can be installed either locally to your project or globally.
If you install globally, be aware that npm/cli#7057
means that plugins and themes will get their own installation of TypeDoc unless you use the
--legacy-peer-deps
flag. This will break many plugins and cause warnings from TypeDoc.
TypeDoc aims to support the two latest TypeScript releases for the current release. Depending on the scale of breaking changes introduced in a new TypeScript version, a given version may support more versions of TypeScript. TypeDoc may work with older (or newer) TypeScript versions, but the supported version range will generally not include versions not supported by DefinitelyTyped.
TypeDoc Version | TypeScript Version | Status |
---|---|---|
0.27 | 5.0 through 5.7 | ✅ Maintained |
0.26 | 4.6 through 5.6 | ⚠️ Security Updates |
0.25 | 4.6 through 5.4 | ❌ Unmaintained |
0.24 | 4.6 through 5.1 | ❌ Unmaintained |
0.23 | 4.6 through 5.0 | ❌ Unmaintained |
0.22 | 4.0 through 4.7 | ❌ Unmaintained |
0.21 | 4.0 through 4.4 | ❌ Unmaintained |
0.20 | 3.9 through 4.2 | ❌ Unmaintained |
0.19 | 3.9 through 4.0 | ❌ Unmaintained |
TypeDoc's CLI can be used through your terminal or npm scripts. Any arguments passed to TypeDoc which are not flags are parsed as entry points. TypeDoc will also read configuration from several files. See Configuration for details on where options are read from.
typedoc --help
typedoc path/to/entry.ts
Options:
--alwaysCreateEntryPointModule When set, TypeDoc will always create a `Module` for entry points, even if only one is provided
--basePath Specifies the base path to be used when displaying file paths
--blockTags Block tags which TypeDoc should recognize when parsing comments
--cacheBust Include the generation time in links to static assets
--cascadedModifierTags Modifier tags which TypeDoc should recognize when parsing comments
--categorizeByGroup Specify whether categorization will be done at the group level
--categoryOrder Specify the order in which categories appear. * indicates the relative order for categories not in the list
--cleanOutputDir If set, TypeDoc will remove the output directory before writing output
--cname Set the CNAME file text, it's useful for custom domains on GitHub Pages
--commentStyle Determines how TypeDoc searches for comments
--customCss Path to a custom CSS file to for the theme to import
--customFooterHtml Custom footer after the TypeDoc link
--customFooterHtmlDisableWrapper If set, disables the wrapper element for customFooterHtml
--customJs Path to a custom JS file to import
--darkHighlightTheme Specify the code highlighting theme in dark mode
--defaultCategory Specify the default category for reflections without a category
--disableGit Assume that all can be linked to with the sourceLinkTemplate, sourceLinkTemplate must be set if this is enabled. {path} will be rooted at basePath
--disableSources Disable setting the source of a reflection when documenting it
--emit Specify what TypeDoc should emit, 'docs', 'both', or 'none'
--entryPoints The entry points of your documentation
--entryPointStrategy The strategy to be used to convert entry points into documentation modules
--exclude Define patterns to be excluded when expanding a directory that was specified as an entry point
--excludeCategories Exclude symbols within this category from the documentation
--excludeExternals Prevent externally resolved symbols from being documented
--excludeInternal Prevent symbols that are marked with @internal from being documented
--excludeNotDocumented Prevent symbols that are not explicitly documented from appearing in the results
--excludeNotDocumentedKinds Specify the type of reflections that can be removed by excludeNotDocumented
--excludePrivate Ignore private variables and methods, defaults to true.
--excludeProtected Ignore protected variables and methods
--excludeReferences If a symbol is exported multiple times, ignore all but the first export
--excludeTags Remove the listed block/modifier tags from doc comments
--externalPattern Define patterns for files that should be considered being external
--externalSymbolLinkMappings Define custom links for symbols not included in the documentation
--favicon Path to favicon to include as the site icon
--githubPages Generate a .nojekyll file to prevent 404 errors in GitHub Pages. Defaults to `true`
--gitRemote Use the specified remote for linking to GitHub/Bitbucket source files. Has no effect if disableGit or disableSources is set
--gitRevision Use specified revision instead of the last revision for linking to GitHub/Bitbucket source files. Has no effect if disableSources is set
--groupOrder Specify the order in which groups appear. * indicates the relative order for groups not in the list
--groupReferencesByType If set, references will be grouped with the type they refer to rather than in a 'References' group
--headings Determines which optional headings are rendered
--help Print this message
--hideGenerator Do not print the TypeDoc link at the end of the page
--highlightLanguages Specify the languages which will be loaded to highlight code when rendering
--hostedBaseUrl Specify a base URL to be used in generating a sitemap.xml in our output folder and canonical links. If not specified, no sitemap will be generated
--html Specify the location where html documentation should be written to.
--includeHierarchySummary If set, a reflections hierarchy summary will be rendered to a summary page. Defaults to `true`
--includeVersion Add the package version to the project name
--inlineTags Inline tags which TypeDoc should recognize when parsing comments
--intentionallyNotExported A list of types which should not produce 'referenced but not documented' warnings
--jsDocCompatibility Sets compatibility options for comment parsing that increase similarity with JSDoc comments
--json Specify the location and filename a JSON file describing the project is written to
--kindSortOrder Specify the sort order for reflections when 'kind' is specified
--lang Sets the language to be used in generation and in TypeDoc's messages
--lightHighlightTheme Specify the code highlighting theme in light mode
--logLevel Specify what level of logging should be used
--markdownLinkExternal Specifies that http[s]:// links in comments and markdown files should be treated as external links to be opened in a new tab
--maxTypeConversionDepth Set the maximum depth of types to be converted
--modifierTags Modifier tags which TypeDoc should recognize when parsing comments
--name Set the name of the project that will be used in the header of the template
--navigation Determines how the navigation sidebar is organized
--navigationLeaves Branches of the navigation tree which should not be expanded
--navigationLinks Defines links to be included in the header
--notRenderedTags Tags which will be preserved in doc comments, but not rendered when creating output
--options Specify a json option file that should be loaded. If not specified TypeDoc will look for 'typedoc.json' in the current directory
--out Specify the location the documentation for the default output should be written to. The default output type may be changed by plugins.
--plugin Specify the npm plugins that should be loaded. Omit to load all installed plugins
--preserveLinkText If set, @link tags without link text will use the text content as the link. If not set, will use the target reflection name
--preserveWatchOutput If set, TypeDoc will not clear the screen between compilation runs
--pretty Specify whether the output JSON should be formatted with tabs
--projectDocuments Documents which should be added as children to the root of the generated documentation. Supports globs to match multiple files
--readme Path to the readme file that should be displayed on the index page. Pass `none` to disable the index page and start the documentation on the globals page
--requiredToBeDocumented A list of reflection kinds that must be documented
--searchInComments If set, the search index will also include comments. This will greatly increase the size of the search index
--searchInDocuments If set, the search index will also include documents. This will greatly increase the size of the search index
--showConfig Print the resolved configuration and exit
--sidebarLinks Defines links to be included in the sidebar
--skipErrorChecking Do not run TypeScript's type checking before generating docs
--sluggerConfiguration Determines how anchors within rendered HTML are determined.
--sort Specify the sort strategy for documented values
--sortEntryPoints If set, entry points will be subject to the same sorting rules as other reflections
--sourceLinkExternal Specifies that source links should be treated as external links to be opened in a new tab
--sourceLinkTemplate Specify a link template to be used when generating source urls. If not set, will be automatically created using the git remote. Supports {path}, {line}, {gitRevision} placeholders
--suppressCommentWarningsInDeclarationFiles Sets the language to be used in generation and in TypeDoc's messages
--theme Specify the theme name to render the documentation with
--titleLink Set the link the title in the header points to. Defaults to the documentation homepage
--treatValidationWarningsAsErrors If set, warnings emitted during validation will be treated as errors. This option cannot be used to disable treatWarningsAsErrors for validation warnings
--treatWarningsAsErrors If set, all warnings will be treated as errors
--tsconfig Specify a TypeScript config file that should be loaded. If not specified TypeDoc will look for 'tsconfig.json' in the current directory
--typePrintWidth Width at which to wrap code to a new line when rendering a type
--useFirstParagraphOfCommentAsSummary If set and no @summary tag is specified, TypeDoc will use the first paragraph of comments as the short summary in the module/namespace view
--useHostedBaseUrlForAbsoluteLinks If set, TypeDoc will produce absolute links to pages on your site using the hostedBaseUrl option
--useTsLinkResolution Use TypeScript's link resolution when determining where @link tags point. This only applies to JSDoc style comments
--validation Specify which validation steps TypeDoc should perform on your generated documentation
--version Print TypeDoc's version
--watch Watch files for changes and rebuild docs on change
Supported highlighting languages:
txt text abap actionscript-3
ada angular-html angular-ts apache
apex apl applescript ara
asciidoc asm astro awk
ballerina bat beancount berry
bibtex bicep blade bsl
c cadence cairo clarity
clojure cmake cobol codeowners
codeql coffee common-lisp coq
cpp crystal csharp css
csv cue cypher d
dart dax desktop diff
docker dotenv dream-maker edge
elixir elm emacs-lisp erb
erlang fennel fish fluent
fortran-fixed-form fortran-free-form fsharp gdresource
gdscript gdshader genie gherkin
git-commit git-rebase gleam glimmer-js
glimmer-ts glsl gnuplot go
graphql groovy hack haml
handlebars haskell haxe hcl
hjson hlsl html html-derivative
http hxml hy imba
ini java javascript jinja
jison json json5 jsonc
jsonl jsonnet jssm jsx
julia kotlin kusto latex
lean less liquid log
logo lua luau make
markdown marko matlab mdc
mdx mermaid mipsasm mojo
move narrat nextflow nginx
nim nix nushell objective-c
objective-cpp ocaml pascal perl
php plsql po postcss
powerquery powershell prisma prolog
proto pug puppet purescript
python qml qmldir qss
r racket raku razor
reg regexp rel riscv
rst ruby rust sas
sass scala scheme scss
sdbl shaderlab shellscript shellsession
smalltalk solidity soy sparql
splunk sql ssh-config stata
stylus svelte swift system-verilog
systemd talonscript tasl tcl
templ terraform tex toml
ts-tags tsv tsx turtle
twig typescript typespec typst
v vala vb verilog
vhdl viml vue vue-html
vyper wasm wenyan wgsl
wikitext wolfram xml xsl
yaml zenscript zig
Supported highlighting themes:
andromeeda aurora-x
ayu-dark catppuccin-frappe
catppuccin-latte catppuccin-macchiato
catppuccin-mocha dark-plus
dracula dracula-soft
everforest-dark everforest-light
github-dark github-dark-default
github-dark-dimmed github-dark-high-contrast
github-light github-light-default
github-light-high-contrast houston
kanagawa-dragon kanagawa-lotus
kanagawa-wave laserwave
light-plus material-theme
material-theme-darker material-theme-lighter
material-theme-ocean material-theme-palenight
min-dark min-light
monokai night-owl
nord one-dark-pro
one-light plastic
poimandres red
rose-pine rose-pine-dawn
rose-pine-moon slack-dark
slack-ochin snazzy-light
solarized-dark solarized-light
synthwave-84 tokyo-night
vesper vitesse-black
vitesse-dark vitesse-light
TypeDoc exposes an API which can be used to run it without any configuration files.
import td from "typedoc";
// Application.bootstrap also exists, which will not load plugins
// Also accepts an array of option readers if you want to disable
// TypeDoc's tsconfig.json/package.json/typedoc.json option readers
const app = await td.Application.bootstrapWithPlugins({
entryPoints: ["src/index.ts"],
});
// May be undefined if errors are encountered.
const project = await app.convert();
if (project) {
const outputDir = "docs";
// Generate HTML rendered docs
await app.generateDocs(project, outputDir);
// Alternatively generate JSON output
await app.generateJson(project, outputDir + "/docs.json");
}