```
Specifies the location to output a JSON file containing all of the reflection data.
An example of the JSON output from running TypeDoc on itself can be seen at [/media/docs.json](../../docs/docs.json).
This option is an output shortcut. If specified, the [outputs](#outputs) option
will be overwritten by this option and any other specified output shortcuts.
## pretty
```bash
$ typedoc --json out.json --pretty
```
Tells TypeDoc to pretty-format the JSON output. Defaults to true.
## emit
```bash
$ typedoc --emit none
```
Instructs TypeDoc to write compiled output files as `tsc` does.
| Value | Behavior |
| ------ | ---------------------------------------------- |
| `docs` | Emit documentation, but not JS (default). |
| `both` | Emit both documentation and JS. |
| `none` | Emit nothing, just convert and run validation. |
> [!note]
> If TypeScript is configured with `declaration: true` (through `tsconfig.json`)
> then the TypeDoc emit `both` option will also generate type declaration files.
## theme
```bash
$ typedoc --theme default
```
Specify the theme name that should be used.
## router
```bash
$ typedoc --router default
```
Specify the router that should be used to determine what files to create for the
HTML output and how to link between pages. Additional routers may be added by
plugins/themes. TypeDoc ships with the following builtin routers:
- **kind** (default) - Creates folders according to their the documented member's kind.
- **kind-dir** - Like **kind**, but renders each page as `index.html` within a directory for the page name. This can be used to make "clean" urls.
- **structure** - Creates folders according to the module structure.
- **structure-dir** - Like **structure**, but renders each page as `index.html` within a directory for the page name. This can be used to make "clean" urls.
- **group** - Creates folders according to the reflection's [`@group`](../tags/group.md).
- **category** - Creates folders according to the reflection's [`@category`](../tags/category.md).
This is easiest to understand with an example. Given the following API:
```ts
export function initialize(): void;
/** @group Opts */
export class Options {}
export namespace TypeDoc {
export const VERSION: string;
}
```
TypeDoc will create a folder structure resembling the following, the common
`assets` folder and `index.html` / `modules.html` files have been omitted for
brevity.
**kind**
```text
docs
├── classes
│ └── Options.html
├── functions
│ └── initialize.html
├── modules
│ └── TypeDoc.html
└── variables
└── TypeDoc.VERSION.html
```
**structure**
```text
├── initialize.html
├── Options.html
├── TypeDoc
│ └── VERSION.html
└── TypeDoc.html
```
**groups**
```text
docs
├── Opts
│ └── Options.html
├── Functions
│ └── initialize.html
├── Namespaces
│ └── TypeDoc.html
└── Variables
└── TypeDoc.VERSION.html
```
## lightHighlightTheme
```bash
$ typedoc --lightHighlightTheme light-plus
```
Specify the Shiki theme to be used to highlight code snippets in light mode.
## darkHighlightTheme
```bash
$ typedoc --darkHighlightTheme dark-plus
```
Specify the Shiki theme to be used to highlight code snippets in dark mode.
## highlightLanguages
Specifies the Shiki grammars to load for highlighting code blocks. By default, TypeDoc
loads the following languages.
```json
{
"highlightLanguages": [
"bash",
"console",
"css",
"html",
"javascript",
"json",
"jsonc",
"json5",
"tsx",
"typescript"
]
}
```
## ignoredHighlightLanguages
Specifies languages used in code blocks which should be silently ignored by TypeDoc.
By default, TypeDoc will produce a warning if a code block specifies a language which
is not present in the highlightLanguages array.
```json
{
"ignoredHighlightLanguages": ["mkdocs"]
}
```
## typePrintWidth
Specifies the width at which to wrap code when rendering types, defaults to 80.
Changing this is not advised without tweaks to the theme in use.
```bash
typedoc --typePrintWidth 120
```
## customCss
```bash
$ typedoc --customCss ./theme/style.css
```
Specifies an extra CSS file that should be copied into the assets directory and referenced by the theme.
## customJs
```bash
$ typedoc --customJs ./theme/custom.js
```
Specifies a JavaScript script (not module) file that should be copied into the
assets directory and referenced by the theme.
## customFooterHtml
```bash
$ typedoc --customFooterHtml "Copyright Project 2024"
```
Specifies additional custom HTML which should be injected into the page footer.
## customFooterHtmlDisableWrapper
```bash
$ typedoc --customFooterHtml "Copyright Project 2024
" --customFooterHtmlDisableWrapper
```
By default, TypeDoc will wrap the custom footer HTML in a `` element to allow plain text added
with it to show up properly aligned. This option disables the wrapping.
## markdownItOptions
Specifies the options that are forwarded to [markdown-it](https://github.com/markdown-it/markdown-it) when parsing doc comments.
By default TypeDoc overrides the default values used by markdown-it with the ones shown below:
```json
{
"markdownItOptions": {
"html": true,
"linkify": true
}
}
```
See the [options section](https://github.com/markdown-it/markdown-it?tab=readme-ov-file#init-with-presets-and-options)
in the markdown-it readme for a full list of available options.
## markdownItLoader
Function which can be set in a JS config file to configure plugins loaded by `markdown-it`. It will be called with an
instance of the [`MarkdownIt`](https://markdown-it.github.io/markdown-it/#MarkdownIt) class.
```js
// typedoc.config.mjs
export default {
markdownItLoader(parser) {
parser.use(plugin1);
},
};
```
## displayBasePath
```bash
$ typedoc --displayBasePath ./ --entryPoints src/index.ts
```
Specifies the base path to be used when displaying file paths. If not set, TypeDoc will guess by taking the lowest
common directory to all source files. In the above example, TypeDoc would display links to `index.ts` rather than `src/index.ts`
if `displayBasePath` was not specified. Defaults to the value of [basePath](input.md#basepath)
> [!note]
> This option only affects displayed paths. It _does not_ affect where TypeDoc will create links to.
## cname
```bash
$ typedoc --cname typedoc.org
```
Create a CNAME file in the output directory with the specified text.
## favicon
```bash
$ typedoc --favicon favicon.ico
```
Specify a `.ico`, `.png` or `.svg` file to reference as the site favicon.
## sourceLinkExternal
```bash
$ typedoc --sourceLinkExternal
```
Treat source links as external links that open in a new tab when generating HTML.
## markdownLinkExternal
```bash
$ typedoc --markdownLinkExternal
```
Specifies that `http[s]://` links in comments and markdown files should be
treated as external links to be opened in a new tab
## lang
```bash
$ typedoc --lang zh
```
Sets the `lang` attribute in TypeDoc's HTML output and the translations used when,
generating documentation. Defaults to `en`, resulting in ``.
## locales
```json
// typedoc.json
{
"locales": {
"zh": {
"flag_private": "私有"
}
}
}
```
Specify translations which TypeDoc will used when `--lang` is set to the specified locale.
See [translatable.ts](https://github.com/TypeStrong/typedoc/blob/master/src/lib/internationalization/translatable.ts)
for a list of all potentially translated messages within TypeDoc.
If your translations may be generally useful to the community, please consider submitting a
pull request adding them to TypeDoc!
## githubPages
```bash
$ typedoc --githubPages false
```
When enabled, automatically add a `.nojekyll` file to the output directory to prevent GitHub Pages
from processing your documentation site using Jekyll. If you have scoped packages, TypeDoc
generates HTML files that start with `_` which are ignored by Jekyll. Defaults to `true`.
## cacheBust
```bash
$ typedoc --cacheBust
```
When enabled, TypeDoc will include the generation time in `