Docs
Utility Options

Utility Options

Options that are used for general configuration and utility purposes.

—sanitizeComments

💡
Sanitize HTML and JSX inside JsDoc comments.

Accepts a boolean value. Defaults to false.

Please note this options does not affect the rendering of inline code or code blocks (using single/triple backticks).

By default all comments written inside JsDoc comments will be passed to the output as written, and parsers will interpret un-escaped angle brackets as HTML/JSX tags..

This option will escape angle brackets < > and curly braces { } written inside JsDoc comments.

This option would typically be used when source code comes from an external source exposing the following potential issues:

  • Comments contain raw tags that should be interpreted as code examples.
  • Comments contain invalid syntax that (in the case of MDX) will cause breaking parsing errors.
  • Although most parsers use XSS filters, this option provides an additional layer of XSS security.
typedoc.json
{
  "sanitizeComments": false
}

—textContentMappings

💡
Change specific text placeholders in the template.

Defines placeholder text that can be customized. Includes the main page header and breadcrumbs (if displayed), page titles and page footer.

Default values within curly braces indicates a placeholder of dynamic text.

  • The {projectName} placeholder writes project’s name .
  • The {kind} writes the reflection kind of the page.
  • The {version} placeholder writes package version (if includeVersion is true).

If you are looking for general localization support please see TypeDoc’s --lang and --locales options.

typedoc.json
{
  "textContentMappings": {
    "header.title": "{projectName} {version}",
    "header.docs": "Docs",
    "breadcrumbs.home": "{projectName} {version}",
    "title.indexPage": "{projectName} {version}",
    "title.memberPage": "{kind}: {name}",
    "footer.text": ""
  }
}

—publicPath

💡
Specify the base path for all urls.

Accepts a string value. Defaults to "undefined".

If undefined all urls will be relative.

typedoc.json
{
  "publicPath": "http://abc.com"
}

—anchorPrefix

💡

Custom anchor prefix when anchoring to in-page symbols.

Accepts a string value. Defaults to "undefined".

This option should be used when parsers require a custom anchor prefix.

typedoc.json
{
  "anchorPrefix": "markdown-header"
}

—useHTMLEncodedBrackets

💡
Use HTML encoded entities for angle brackets.

Accepts a boolean value. Defaults to false.

By default, opening and closing angle brackets (< and >) are escaped using backslashes, and most modern Markdown processors handle them consistently. However, using HTML entities (&lt; and &gt;) might be preferable to avoid any inconsistencies with some Markdown processors.

typedoc.json
{
  "useHTMLEncodedBrackets": false
}

—useHTMLAnchors

💡
Add HTML named anchors to headings and table rows.

Accepts a boolean value. Defaults to false.

This option should be used if there are issues when anchoring to symbols within a page.

  • For Markdown parsers that do not automatically assign header ids.
  • When cross referencing symbols that are referenced in a table row.
typedoc.json
{
  "useHTMLAnchors": false
}

—preserveAnchorCasing

💡

Preserve anchor casing when generating link to symbols.

Accepts a boolean value. Defaults to false.

By default references to symbol anchor links are lowercased.

This option can be used for engines that require the preservation of anchor link casing.

typedoc.json
{
  "preserveAnchorCasing": false
}