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