Input Options
These options control what files TypeDoc processes to generate documentation and how the files are processed.
entryPoints
$ typedoc a b
# or
$ typedoc --entryPoints a --entryPoints b
// typedoc.json
{
"entryPoints": ["src/index.ts"]
}
Specifies the entry points to be documented by TypeDoc. TypeDoc will examine the exports of these files and create documentation according to the exports.
Entry points can be handled in one of three ways, see --entryPointStrategy
for details.
The set of entry points provided to TypeDoc determines the names displayed in the documentation.
By default, TypeDoc will derive a basePath based on your entry point
paths to determine the displayed module name, but it can be also be set with the @module
tag.
entryPointStrategy
$ typedoc --entryPointStrategy expand ./src
Specifies how specified entry points should be handled.
resolve (default)
Expects all entry points to be contained within the root level tsconfig project. If a directory is given, includes <directory>/index
as the entry point.
expand (default prior to v0.22.0)
Expects all entry points to be contained within the root level tsconfig project. If a directory is given, its contents are recursively expanded and treated as entry points.
packages
Expects all entry points to be directories to effectively run TypeDoc within. After each entry point has been converted by TypeDoc to a JSON model, the projects will be merged together and rendered to a single site or JSON output. Each package may have its own set of TypeDoc
configuration, but plugins
within sub-projects will not be loaded. See Gerrit0/typedoc-packages-example for an example monorepo which uses this option.
Configuration specified in the root level project will not be copied to child projects.
merge
Expects all entry points to be .json
files generated with a previous run of TypeDoc with the --json
option set. These entry points will be merged into a single project.
alwaysCreateEntryPointModule
By default, if TypeDoc is given only one entry point, it will place exports of that entry point directly within the generated project. If this option is specified, TypeDoc will instead always create a module for the entry point. Has no effect if more than one entry point is passed to TypeDoc.
If --projectDocuments
is used to add documents, this option defaults to true
, otherwise, defaults to false
.
$ typedoc --alwaysCreateEntryPointModule
projectDocuments
Specify additional markdown documents to be added to the generated documentation site. See the External Documents guide for more details.
// typedoc.json
{
"projectDocuments": ["docs/tutorial.md"]
}
exclude
$ typedoc --exclude "**/*+(index|.spec|.e2e).ts"
Exclude files by the given pattern when a path is provided as source. This option is only used to remove files from consideration as
entry points. Unlike TypeScript's exclude
option, it cannot be used to exclude files from compilation. You may want to turn on TypeScript's
--skipLibCheck if you have compilation errors originating in @types
packages.
Important: To exclude files or paths entirely, use TypeScript's exclude
option in your tsconfig.json
. TypeDoc will not include any files excluded by tsconfig.json
. See issue #1928 for further discussion.
Supports minimatch patterns. In configuration files, this option accepts an array of patterns. On the command line, it may be specified multiple times to add multiple patterns. If an exported member from one of your entry points is located in an excluded file, it will be excluded from the documentation.
If entryPointStrategy
is set to packages
, then you can specify package directories with this option to exclude from documentation.
externalPattern
$ typedoc --externalPattern 'lib/**/*.ts' --externalPattern 'external/**/*.ts'
Define patterns for extra files that should be considered external. Can be used along with --excludeExternals
to remove external modules from the documentation.
excludeExternals
$ typedoc --excludeExternals
Prevent externally resolved TypeScript files from being documented. Defaults to false.
excludeNotDocumented
$ typedoc --excludeNotDocumented
Removes symbols from the generated documentation which do not have an associated doc comment if they are matched by excludeNotDocumentedKinds
.
excludeNotDocumentedKinds
// typedoc.json
{
"excludeNotDocumented": true,
"excludeNotDocumentedKinds": ["Property", "Interface", "TypeAlias"]
}
Specifies the kinds of member which can be removed by excludeNotDocumented
. Defaults to:
{
"excludeNotDocumentedKinds": [
"Module",
"Namespace",
"Enum",
// "EnumMember", // Not enabled by default
"Variable",
"Function",
"Class",
"Interface",
"Constructor",
"Property",
"Method",
"CallSignature",
"IndexSignature",
"ConstructorSignature",
"Accessor",
"GetSignature",
"SetSignature",
"TypeAlias",
"Reference"
]
}
excludeInternal
$ typedoc --excludeInternal
Removes symbols annotated with the @internal
doc tag. Defaults to true if the stripInternal compiler option is set to true, otherwise defaults to false.
excludePrivate
$ typedoc --excludePrivate
Removes private class members from the generated documentation. Defaults to true.
excludeProtected
$ typedoc --excludeProtected
Removes protected class members from the generated documentation. Defaults to false.
excludeReferences
$ typedoc --excludeReferences
Removes re-exports of a symbol already included in the documentation from the documentation. Defaults to false.
excludeCategories
$ typedoc --excludeCategories A --excludeCategories B
Removes reflections associated with any of the given categories.
name
$ typedoc --name <Documentation title>
Set the name of the project that will be used in the header of the template.
The name defaults to the package name according to your package.json
.
includeVersion
$ typedoc --includeVersion
Includes the version according to package.json
in generated documentation. Defaults to false.
disableSources
$ typedoc --disableSources
Disables capturing where reflections are declared when converting input.
sourceLinkTemplate
$ typedoc --sourceLinkTemplate 'https://vcs.example.com/{path}?at={gitRevision}#line={line}'
Has no effect if --disableSources
is set.
Specify a link template to be used when generating source urls. If not set, will be automatically created
using the git remote for GitHub, GitLab, and BitBucket urls. Supports {path}
, {line}
, and {gitRevision}
placeholders.
gitRevision
$ typedoc --gitRevision <revision|branch>
Has no effect if --disableSources
is set.
Use specified revision or branch instead of the last revision for linking to source files. Defaults to the last commit.
gitRemote
$ typedoc --gitRemote <remote>
Has no effect if --disableSources
is set.
Use the specified git remote instead of origin
for linking to source files in GitHub, Bitbucket, or GitLab.
You can use git remote
to view a list of valid remotes.
If you are updating documentation for a forked package, you probably want to pass --gitRemote upstream
.
disableGit
$ typedoc --disableGit
Prevents TypeDoc from using Git to try to determine if sources can be linked, with this enabled, sources will always be linked, even if not part of a git repo.
readme
$ typedoc --readme <path/to/readme|none>
Path to the readme file that should be displayed on the index page. If no readme is discovered or read, the index page will be disabled. You can also specify "none" to explicitly disable the index page.