docusaurus-plugin-typedoc
Version:
A Docusaurus plugin to integrate TypeDoc ( + typedoc-plugin-markdown ) into a Docusaurus project.
37 lines (36 loc) • 1.26 kB
JavaScript
import { ParameterType } from 'typedoc';
import { DEFAULT_SIDEBAR_OPTIONS } from './options.js';
/**
* **autoConfiguration**
*
* Set to `false` to disable sidebar generation. Defaults to `true`.
*
* **typescript**
*
* Set to `true` to generate a TypeScript file. Defaults to `false` (CommonJs).
*
* **pretty**
*
* Pretty format the sidebar JSON. Defaults to `false`.
*
* **deprecatedItemClassName**
*
* The class name to apply to deprecated items in the sidebar. Defaults to `"typedoc-sidebar-item-deprecated"`.
*
* Please see the [sidebar guide](/plugins/docusaurus/guides/sidebar) for additional information on sidebar setup.
*
*/
export const sidebar = {
help: 'Configures the autogenerated Docusaurus sidebar.',
type: ParameterType.Mixed,
defaultValue: DEFAULT_SIDEBAR_OPTIONS,
validate(value) {
if (typeof value !== 'object') {
console.warn('[typedoc-plugin-markdown] Sidebar must be an object.');
}
const invalidKeys = Object.keys(value).filter((key) => !Object.keys(DEFAULT_SIDEBAR_OPTIONS).includes(key));
if (invalidKeys.length > 0) {
console.warn(`[typedoc-plugin-markdown] Invalid keys in sidebar options: ${invalidKeys.join(', ')}`);
}
},
};