TypeDoc Usage
This plugin is like any other TypeDoc plugin and is fully compatible with the TypeDoc ecosystem, supporting other plugins (not specifically targetting HTML output) and the majority of TypeDoc’s options.
Supported TypeDoc Options
Pre-Render Options
The majority of TypeDoc’s options are used internally by TypeDoc to convert a project and define the structure of the models.
These options are output/theme agnostic and can be set in the same way as you would with the HTML theme:
- Configuration Yes ✅
- Input Yes ✅
- Comments Yes ✅
- Organization Yes ✅
- Validation Yes ✅
- Other Yes ✅
Output Options
TypeDoc’s Output options are used by the renderer and theme. The majority of these options are specific to HTML output and are not applicable to markdown output.
Below is a list of which TypeDoc Output options are supported:
--out
Yes ✅--navigation
Yes ✅ (See Utilizing Navigation)--theme
Yes ✅ (theme should be MarkdownTheme instance)--cleanOutputDir
Yes ✅--lang
Yes ✅--locale
Yes ✅--basePath
Yes ✅--githubPages
Yes ✅ (defaults tofalse
)--hideParameterTypesInTitle
No ❌ (use--expandParameters
)--titleLink
No ❌--navigationLinks
No ❌--sidebarLinks
No ❌--navigationLeaves
No ❌--lightHighlightTheme
No ❌--darkHighlightTheme
No ❌--customCss
No ❌--markedOptions
No ❌--cname
No ❌--sourceLinkExternal
No ❌--htmlLang
No ❌--cacheBust
No ❌--gaID
No ❌--hideGenerator
No ❌--searchInComments
No ❌
Option Typings
You can inform your IDE about the shape of the exported options the plugin provides.
JSON Files
You can utilize the provided JSON schema at https://typedoc-plugin-markdown.org/schema.json. For simplicity of configuration, this schema consolidates all options from TypeDoc and the plugin.
{
"$schema": "https://typedoc-plugin-markdown.org/schema.json",
"entryPoints": ["./src/index.ts", "./src/secondary-entry.ts"],
"out": "docs",
"plugin": ["typedoc-plugin-markdown", "some-other-plugin"],
};
JavaScript Files
For JavaScript files, the PluginOptions
interface can be imported to a typedoc.config.js
file with a @type
annotation.
You can use intersection types to combine the TypeDoc options with the plugin options.
// @ts-check
/** @type {import('typedoc').TypeDocOptions & import('typedoc-plugin-markdown').PluginOptions} */
module.exports = {
entryPoints: ['./src/index.ts', './src/secondary-entry.ts'],
out: 'doc',
plugin: ['typedoc-plugin-markdown', 'some-other-plugin'],
};