typedoc-plugin-markdown
Version:
A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
21 lines (20 loc) • 768 B
JavaScript
import { heading } from '../../../libs/markdown/index.js';
import { ReflectionKind } from 'typedoc';
export function memberContainer(model, options) {
const md = [];
if (!this.router.hasOwnDocument(model) &&
this.router.hasUrl(model) &&
this.router.getAnchor(model) &&
this.options.getValue('useHTMLAnchors')) {
md.push(`<a id="${this.router.getAnchor(model)}"></a>`);
}
if (!this.router.hasOwnDocument(model) &&
![ReflectionKind.Constructor].includes(model.kind)) {
md.push(heading(options.headingLevel, this.partials.memberTitle(model)));
}
md.push(this.partials.member(model, {
headingLevel: options.headingLevel,
nested: options.nested,
}));
return md.join('\n\n');
}