@microsoft/api-documenter
Version:
Read JSON files from api-extractor, generate documentation pages
51 lines • 2.51 kB
JavaScript
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { TSDocConfiguration, DocNodeKind } from '@microsoft/tsdoc';
import { DocEmphasisSpan } from './DocEmphasisSpan';
import { DocHeading } from './DocHeading';
import { DocNoteBox } from './DocNoteBox';
import { DocTable } from './DocTable';
import { DocTableCell } from './DocTableCell';
import { DocTableRow } from './DocTableRow';
/**
* Identifies custom subclasses of {@link DocNode}.
*/
export var CustomDocNodeKind;
(function (CustomDocNodeKind) {
CustomDocNodeKind["EmphasisSpan"] = "EmphasisSpan";
CustomDocNodeKind["Heading"] = "Heading";
CustomDocNodeKind["NoteBox"] = "NoteBox";
CustomDocNodeKind["Table"] = "Table";
CustomDocNodeKind["TableCell"] = "TableCell";
CustomDocNodeKind["TableRow"] = "TableRow";
})(CustomDocNodeKind || (CustomDocNodeKind = {}));
export class CustomDocNodes {
static get configuration() {
if (CustomDocNodes._configuration === undefined) {
const configuration = new TSDocConfiguration();
configuration.docNodeManager.registerDocNodes('@micrososft/api-documenter', [
{ docNodeKind: CustomDocNodeKind.EmphasisSpan, constructor: DocEmphasisSpan },
{ docNodeKind: CustomDocNodeKind.Heading, constructor: DocHeading },
{ docNodeKind: CustomDocNodeKind.NoteBox, constructor: DocNoteBox },
{ docNodeKind: CustomDocNodeKind.Table, constructor: DocTable },
{ docNodeKind: CustomDocNodeKind.TableCell, constructor: DocTableCell },
{ docNodeKind: CustomDocNodeKind.TableRow, constructor: DocTableRow }
]);
configuration.docNodeManager.registerAllowableChildren(CustomDocNodeKind.EmphasisSpan, [
DocNodeKind.PlainText,
DocNodeKind.SoftBreak
]);
configuration.docNodeManager.registerAllowableChildren(DocNodeKind.Section, [
CustomDocNodeKind.Heading,
CustomDocNodeKind.NoteBox,
CustomDocNodeKind.Table
]);
configuration.docNodeManager.registerAllowableChildren(DocNodeKind.Paragraph, [
CustomDocNodeKind.EmphasisSpan
]);
CustomDocNodes._configuration = configuration;
}
return CustomDocNodes._configuration;
}
}
//# sourceMappingURL=CustomDocNodeKind.js.map