@microsoft/api-documenter 7.28.9 → 7.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +58 -0
- package/CHANGELOG.md +15 -1
- package/bin/api-documenter +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-esm/cli/ApiDocumenterCommandLine.js +22 -0
- package/lib-esm/cli/ApiDocumenterCommandLine.js.map +1 -0
- package/lib-esm/cli/BaseAction.js +93 -0
- package/lib-esm/cli/BaseAction.js.map +1 -0
- package/lib-esm/cli/GenerateAction.js +45 -0
- package/lib-esm/cli/GenerateAction.js.map +1 -0
- package/lib-esm/cli/MarkdownAction.js +24 -0
- package/lib-esm/cli/MarkdownAction.js.map +1 -0
- package/lib-esm/cli/YamlAction.js +43 -0
- package/lib-esm/cli/YamlAction.js.map +1 -0
- package/lib-esm/documenters/DocumenterConfig.js +43 -0
- package/lib-esm/documenters/DocumenterConfig.js.map +1 -0
- package/lib-esm/documenters/ExperimentalYamlDocumenter.js +136 -0
- package/lib-esm/documenters/ExperimentalYamlDocumenter.js.map +1 -0
- package/lib-esm/documenters/IConfigFile.js +4 -0
- package/lib-esm/documenters/IConfigFile.js.map +1 -0
- package/lib-esm/documenters/MarkdownDocumenter.js +987 -0
- package/lib-esm/documenters/MarkdownDocumenter.js.map +1 -0
- package/lib-esm/documenters/OfficeYamlDocumenter.js +101 -0
- package/lib-esm/documenters/OfficeYamlDocumenter.js.map +1 -0
- package/lib-esm/documenters/YamlDocumenter.js +804 -0
- package/lib-esm/documenters/YamlDocumenter.js.map +1 -0
- package/lib-esm/index.js +6 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/markdown/CustomMarkdownEmitter.js +146 -0
- package/lib-esm/markdown/CustomMarkdownEmitter.js.map +1 -0
- package/lib-esm/markdown/MarkdownEmitter.js +190 -0
- package/lib-esm/markdown/MarkdownEmitter.js.map +1 -0
- package/lib-esm/nodes/CustomDocNodeKind.js +51 -0
- package/lib-esm/nodes/CustomDocNodeKind.js.map +1 -0
- package/lib-esm/nodes/DocEmphasisSpan.js +20 -0
- package/lib-esm/nodes/DocEmphasisSpan.js.map +1 -0
- package/lib-esm/nodes/DocHeading.js +26 -0
- package/lib-esm/nodes/DocHeading.js.map +1 -0
- package/lib-esm/nodes/DocNoteBox.js +22 -0
- package/lib-esm/nodes/DocNoteBox.js.map +1 -0
- package/lib-esm/nodes/DocTable.js +56 -0
- package/lib-esm/nodes/DocTable.js.map +1 -0
- package/lib-esm/nodes/DocTableCell.js +18 -0
- package/lib-esm/nodes/DocTableCell.js.map +1 -0
- package/lib-esm/nodes/DocTableRow.js +47 -0
- package/lib-esm/nodes/DocTableRow.js.map +1 -0
- package/lib-esm/plugin/IApiDocumenterPluginManifest.js +4 -0
- package/lib-esm/plugin/IApiDocumenterPluginManifest.js.map +1 -0
- package/lib-esm/plugin/MarkdownDocumenterAccessor.js +26 -0
- package/lib-esm/plugin/MarkdownDocumenterAccessor.js.map +1 -0
- package/lib-esm/plugin/MarkdownDocumenterFeature.js +47 -0
- package/lib-esm/plugin/MarkdownDocumenterFeature.js.map +1 -0
- package/lib-esm/plugin/PluginFeature.js +54 -0
- package/lib-esm/plugin/PluginFeature.js.map +1 -0
- package/lib-esm/plugin/PluginLoader.js +78 -0
- package/lib-esm/plugin/PluginLoader.js.map +1 -0
- package/lib-esm/schemas/api-documenter-template.json +99 -0
- package/lib-esm/schemas/api-documenter.schema.json +47 -0
- package/lib-esm/start.js +12 -0
- package/lib-esm/start.js.map +1 -0
- package/lib-esm/utils/IndentedWriter.js +235 -0
- package/lib-esm/utils/IndentedWriter.js.map +1 -0
- package/lib-esm/utils/ToSdpConvertHelper.js +338 -0
- package/lib-esm/utils/ToSdpConvertHelper.js.map +1 -0
- package/lib-esm/utils/Utilities.js +24 -0
- package/lib-esm/utils/Utilities.js.map +1 -0
- package/lib-esm/yaml/ISDPYamlFile.js +4 -0
- package/lib-esm/yaml/ISDPYamlFile.js.map +1 -0
- package/lib-esm/yaml/IYamlApiFile.js +4 -0
- package/lib-esm/yaml/IYamlApiFile.js.map +1 -0
- package/lib-esm/yaml/IYamlTocFile.js +4 -0
- package/lib-esm/yaml/IYamlTocFile.js.map +1 -0
- package/lib-esm/yaml/typescript.schema.json +643 -0
- package/package.json +37 -9
- /package/{lib → lib-commonjs}/cli/ApiDocumenterCommandLine.js +0 -0
- /package/{lib → lib-commonjs}/cli/ApiDocumenterCommandLine.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/BaseAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/BaseAction.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/GenerateAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/GenerateAction.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/MarkdownAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/MarkdownAction.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/YamlAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/YamlAction.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/DocumenterConfig.js +0 -0
- /package/{lib → lib-commonjs}/documenters/DocumenterConfig.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/ExperimentalYamlDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/ExperimentalYamlDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/IConfigFile.js +0 -0
- /package/{lib → lib-commonjs}/documenters/IConfigFile.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/MarkdownDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/MarkdownDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/OfficeYamlDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/OfficeYamlDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/documenters/YamlDocumenter.js +0 -0
- /package/{lib → lib-commonjs}/documenters/YamlDocumenter.js.map +0 -0
- /package/{lib → lib-commonjs}/index.js +0 -0
- /package/{lib → lib-commonjs}/index.js.map +0 -0
- /package/{lib → lib-commonjs}/markdown/CustomMarkdownEmitter.js +0 -0
- /package/{lib → lib-commonjs}/markdown/CustomMarkdownEmitter.js.map +0 -0
- /package/{lib → lib-commonjs}/markdown/MarkdownEmitter.js +0 -0
- /package/{lib → lib-commonjs}/markdown/MarkdownEmitter.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/CustomDocNodeKind.js +0 -0
- /package/{lib → lib-commonjs}/nodes/CustomDocNodeKind.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocEmphasisSpan.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocEmphasisSpan.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocHeading.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocHeading.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocNoteBox.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocNoteBox.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTable.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTable.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableCell.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableCell.js.map +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableRow.js +0 -0
- /package/{lib → lib-commonjs}/nodes/DocTableRow.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/IApiDocumenterPluginManifest.js +0 -0
- /package/{lib → lib-commonjs}/plugin/IApiDocumenterPluginManifest.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterAccessor.js +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterAccessor.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterFeature.js +0 -0
- /package/{lib → lib-commonjs}/plugin/MarkdownDocumenterFeature.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginFeature.js +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginFeature.js.map +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginLoader.js +0 -0
- /package/{lib → lib-commonjs}/plugin/PluginLoader.js.map +0 -0
- /package/{lib → lib-commonjs}/schemas/api-documenter-template.json +0 -0
- /package/{lib → lib-commonjs}/schemas/api-documenter.schema.json +0 -0
- /package/{lib → lib-commonjs}/start.js +0 -0
- /package/{lib → lib-commonjs}/start.js.map +0 -0
- /package/{lib → lib-commonjs}/utils/IndentedWriter.js +0 -0
- /package/{lib → lib-commonjs}/utils/IndentedWriter.js.map +0 -0
- /package/{lib → lib-commonjs}/utils/ToSdpConvertHelper.js +0 -0
- /package/{lib → lib-commonjs}/utils/ToSdpConvertHelper.js.map +0 -0
- /package/{lib → lib-commonjs}/utils/Utilities.js +0 -0
- /package/{lib → lib-commonjs}/utils/Utilities.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/ISDPYamlFile.js +0 -0
- /package/{lib → lib-commonjs}/yaml/ISDPYamlFile.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlApiFile.js +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlApiFile.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlTocFile.js +0 -0
- /package/{lib → lib-commonjs}/yaml/IYamlTocFile.js.map +0 -0
- /package/{lib → lib-commonjs}/yaml/typescript.schema.json +0 -0
- /package/{lib → lib-dts}/cli/ApiDocumenterCommandLine.d.ts +0 -0
- /package/{lib → lib-dts}/cli/ApiDocumenterCommandLine.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/BaseAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/BaseAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/GenerateAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/GenerateAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/MarkdownAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/MarkdownAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/YamlAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/YamlAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/DocumenterConfig.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/DocumenterConfig.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/ExperimentalYamlDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/ExperimentalYamlDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/IConfigFile.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/IConfigFile.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/MarkdownDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/MarkdownDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/OfficeYamlDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/OfficeYamlDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/documenters/YamlDocumenter.d.ts +0 -0
- /package/{lib → lib-dts}/documenters/YamlDocumenter.d.ts.map +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts.map +0 -0
- /package/{lib → lib-dts}/markdown/CustomMarkdownEmitter.d.ts +0 -0
- /package/{lib → lib-dts}/markdown/CustomMarkdownEmitter.d.ts.map +0 -0
- /package/{lib → lib-dts}/markdown/MarkdownEmitter.d.ts +0 -0
- /package/{lib → lib-dts}/markdown/MarkdownEmitter.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/CustomDocNodeKind.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/CustomDocNodeKind.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocEmphasisSpan.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocEmphasisSpan.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocHeading.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocHeading.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocNoteBox.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocNoteBox.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocTable.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocTable.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocTableCell.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocTableCell.d.ts.map +0 -0
- /package/{lib → lib-dts}/nodes/DocTableRow.d.ts +0 -0
- /package/{lib → lib-dts}/nodes/DocTableRow.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/IApiDocumenterPluginManifest.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/IApiDocumenterPluginManifest.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterAccessor.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterAccessor.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterFeature.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/MarkdownDocumenterFeature.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/PluginFeature.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/PluginFeature.d.ts.map +0 -0
- /package/{lib → lib-dts}/plugin/PluginLoader.d.ts +0 -0
- /package/{lib → lib-dts}/plugin/PluginLoader.d.ts.map +0 -0
- /package/{lib → lib-dts}/start.d.ts +0 -0
- /package/{lib → lib-dts}/start.d.ts.map +0 -0
- /package/{lib → lib-dts}/utils/IndentedWriter.d.ts +0 -0
- /package/{lib → lib-dts}/utils/IndentedWriter.d.ts.map +0 -0
- /package/{lib → lib-dts}/utils/ToSdpConvertHelper.d.ts +0 -0
- /package/{lib → lib-dts}/utils/ToSdpConvertHelper.d.ts.map +0 -0
- /package/{lib → lib-dts}/utils/Utilities.d.ts +0 -0
- /package/{lib → lib-dts}/utils/Utilities.d.ts.map +0 -0
- /package/{lib → lib-dts}/yaml/ISDPYamlFile.d.ts +0 -0
- /package/{lib → lib-dts}/yaml/ISDPYamlFile.d.ts.map +0 -0
- /package/{lib → lib-dts}/yaml/IYamlApiFile.d.ts +0 -0
- /package/{lib → lib-dts}/yaml/IYamlApiFile.d.ts.map +0 -0
- /package/{lib → lib-dts}/yaml/IYamlTocFile.d.ts +0 -0
- /package/{lib → lib-dts}/yaml/IYamlTocFile.d.ts.map +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { DocNodeContainer } from '@microsoft/tsdoc';
|
|
4
|
+
import { CustomDocNodeKind } from './CustomDocNodeKind';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a span of text that is styled with CommonMark emphasis (italics), strong emphasis (boldface),
|
|
7
|
+
* or both.
|
|
8
|
+
*/
|
|
9
|
+
export class DocEmphasisSpan extends DocNodeContainer {
|
|
10
|
+
constructor(parameters, children) {
|
|
11
|
+
super(parameters, children);
|
|
12
|
+
this.bold = !!parameters.bold;
|
|
13
|
+
this.italic = !!parameters.italic;
|
|
14
|
+
}
|
|
15
|
+
/** @override */
|
|
16
|
+
get kind() {
|
|
17
|
+
return CustomDocNodeKind.EmphasisSpan;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=DocEmphasisSpan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocEmphasisSpan.js","sourceRoot":"","sources":["../../src/nodes/DocEmphasisSpan.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAgB,gBAAgB,EAAoC,MAAM,kBAAkB,CAAC;AAEpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,gBAAgB;IAInD,YAAmB,UAAsC,EAAE,QAAoB;QAC7E,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;IACpC,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,iBAAiB,CAAC,YAAY,CAAC;IACxC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type DocNode, DocNodeContainer, type IDocNodeContainerParameters } from '@microsoft/tsdoc';\n\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\n\n/**\n * Constructor parameters for {@link DocEmphasisSpan}.\n */\nexport interface IDocEmphasisSpanParameters extends IDocNodeContainerParameters {\n bold?: boolean;\n italic?: boolean;\n}\n\n/**\n * Represents a span of text that is styled with CommonMark emphasis (italics), strong emphasis (boldface),\n * or both.\n */\nexport class DocEmphasisSpan extends DocNodeContainer {\n public readonly bold: boolean;\n public readonly italic: boolean;\n\n public constructor(parameters: IDocEmphasisSpanParameters, children?: DocNode[]) {\n super(parameters, children);\n this.bold = !!parameters.bold;\n this.italic = !!parameters.italic;\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.EmphasisSpan;\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { DocNode } from '@microsoft/tsdoc';
|
|
4
|
+
import { CustomDocNodeKind } from './CustomDocNodeKind';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a section header similar to an HTML `<h1>` or `<h2>` element.
|
|
7
|
+
*/
|
|
8
|
+
export class DocHeading extends DocNode {
|
|
9
|
+
/**
|
|
10
|
+
* Don't call this directly. Instead use {@link TSDocParser}
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
constructor(parameters) {
|
|
14
|
+
super(parameters);
|
|
15
|
+
this.title = parameters.title;
|
|
16
|
+
this.level = parameters.level !== undefined ? parameters.level : 1;
|
|
17
|
+
if (this.level < 1 || this.level > 5) {
|
|
18
|
+
throw new Error('IDocHeadingParameters.level must be a number between 1 and 5');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** @override */
|
|
22
|
+
get kind() {
|
|
23
|
+
return CustomDocNodeKind.Heading;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=DocHeading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocHeading.js","sourceRoot":"","sources":["../../src/nodes/DocHeading.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAA2B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IAIrC;;;OAGG;IACH,YAAmB,UAAiC;QAClD,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAEnE,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,iBAAiB,CAAC,OAAO,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type IDocNodeParameters, DocNode } from '@microsoft/tsdoc';\n\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\n\n/**\n * Constructor parameters for {@link DocHeading}.\n */\nexport interface IDocHeadingParameters extends IDocNodeParameters {\n title: string;\n level?: number;\n}\n\n/**\n * Represents a section header similar to an HTML `<h1>` or `<h2>` element.\n */\nexport class DocHeading extends DocNode {\n public readonly title: string;\n public readonly level: number;\n\n /**\n * Don't call this directly. Instead use {@link TSDocParser}\n * @internal\n */\n public constructor(parameters: IDocHeadingParameters) {\n super(parameters);\n this.title = parameters.title;\n this.level = parameters.level !== undefined ? parameters.level : 1;\n\n if (this.level < 1 || this.level > 5) {\n throw new Error('IDocHeadingParameters.level must be a number between 1 and 5');\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.Heading;\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { DocNode, DocSection } from '@microsoft/tsdoc';
|
|
4
|
+
import { CustomDocNodeKind } from './CustomDocNodeKind';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a note box, which is typically displayed as a bordered box containing informational text.
|
|
7
|
+
*/
|
|
8
|
+
export class DocNoteBox extends DocNode {
|
|
9
|
+
constructor(parameters, sectionChildNodes) {
|
|
10
|
+
super(parameters);
|
|
11
|
+
this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);
|
|
12
|
+
}
|
|
13
|
+
/** @override */
|
|
14
|
+
get kind() {
|
|
15
|
+
return CustomDocNodeKind.NoteBox;
|
|
16
|
+
}
|
|
17
|
+
/** @override */
|
|
18
|
+
onGetChildNodes() {
|
|
19
|
+
return [this.content];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=DocNoteBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocNoteBox.js","sourceRoot":"","sources":["../../src/nodes/DocNoteBox.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAA2B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IAGrC,YAAmB,UAAiC,EAAE,iBAA0C;QAC9F,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC1F,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,iBAAiB,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type IDocNodeParameters, DocNode, DocSection } from '@microsoft/tsdoc';\n\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\n\n/**\n * Constructor parameters for {@link DocNoteBox}.\n */\nexport interface IDocNoteBoxParameters extends IDocNodeParameters {}\n\n/**\n * Represents a note box, which is typically displayed as a bordered box containing informational text.\n */\nexport class DocNoteBox extends DocNode {\n public readonly content: DocSection;\n\n public constructor(parameters: IDocNoteBoxParameters, sectionChildNodes?: ReadonlyArray<DocNode>) {\n super(parameters);\n this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.NoteBox;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return [this.content];\n }\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { DocNode } from '@microsoft/tsdoc';
|
|
4
|
+
import { CustomDocNodeKind } from './CustomDocNodeKind';
|
|
5
|
+
import { DocTableRow } from './DocTableRow';
|
|
6
|
+
/**
|
|
7
|
+
* Represents table, similar to an HTML `<table>` element.
|
|
8
|
+
*/
|
|
9
|
+
export class DocTable extends DocNode {
|
|
10
|
+
constructor(parameters, rows) {
|
|
11
|
+
super(parameters);
|
|
12
|
+
this.header = new DocTableRow({ configuration: this.configuration });
|
|
13
|
+
this._rows = [];
|
|
14
|
+
if (parameters) {
|
|
15
|
+
if (parameters.headerTitles) {
|
|
16
|
+
if (parameters.headerCells) {
|
|
17
|
+
throw new Error('IDocTableParameters.headerCells and IDocTableParameters.headerTitles' +
|
|
18
|
+
' cannot both be specified');
|
|
19
|
+
}
|
|
20
|
+
for (const cellText of parameters.headerTitles) {
|
|
21
|
+
this.header.addPlainTextCell(cellText);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else if (parameters.headerCells) {
|
|
25
|
+
for (const cell of parameters.headerCells) {
|
|
26
|
+
this.header.addCell(cell);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (rows) {
|
|
31
|
+
for (const row of rows) {
|
|
32
|
+
this.addRow(row);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** @override */
|
|
37
|
+
get kind() {
|
|
38
|
+
return CustomDocNodeKind.Table;
|
|
39
|
+
}
|
|
40
|
+
get rows() {
|
|
41
|
+
return this._rows;
|
|
42
|
+
}
|
|
43
|
+
addRow(row) {
|
|
44
|
+
this._rows.push(row);
|
|
45
|
+
}
|
|
46
|
+
createAndAddRow() {
|
|
47
|
+
const row = new DocTableRow({ configuration: this.configuration });
|
|
48
|
+
this.addRow(row);
|
|
49
|
+
return row;
|
|
50
|
+
}
|
|
51
|
+
/** @override */
|
|
52
|
+
onGetChildNodes() {
|
|
53
|
+
return [this.header, ...this._rows];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=DocTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocTable.js","sourceRoot":"","sources":["../../src/nodes/DocTable.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAA2B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAW5C;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,OAAO;IAKnC,YAAmB,UAA+B,EAAE,IAAiC;QACnF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,MAAM,GAAG,IAAI,WAAW,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACrE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAEhB,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;gBAC5B,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;oBAC3B,MAAM,IAAI,KAAK,CACb,sEAAsE;wBACpE,2BAA2B,CAC9B,CAAC;gBACJ,CAAC;gBACD,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;oBAC/C,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;iBAAM,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;gBAClC,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;oBAC1C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,IAAI,EAAE,CAAC;YACT,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,iBAAiB,CAAC,KAAK,CAAC;IACjC,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,GAAgB;QAC5B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAEM,eAAe;QACpB,MAAM,GAAG,GAAgB,IAAI,WAAW,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAChF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type IDocNodeParameters, DocNode } from '@microsoft/tsdoc';\n\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\nimport { DocTableRow } from './DocTableRow';\nimport type { DocTableCell } from './DocTableCell';\n\n/**\n * Constructor parameters for {@link DocTable}.\n */\nexport interface IDocTableParameters extends IDocNodeParameters {\n headerCells?: ReadonlyArray<DocTableCell>;\n headerTitles?: string[];\n}\n\n/**\n * Represents table, similar to an HTML `<table>` element.\n */\nexport class DocTable extends DocNode {\n public readonly header: DocTableRow;\n\n private _rows: DocTableRow[];\n\n public constructor(parameters: IDocTableParameters, rows?: ReadonlyArray<DocTableRow>) {\n super(parameters);\n\n this.header = new DocTableRow({ configuration: this.configuration });\n this._rows = [];\n\n if (parameters) {\n if (parameters.headerTitles) {\n if (parameters.headerCells) {\n throw new Error(\n 'IDocTableParameters.headerCells and IDocTableParameters.headerTitles' +\n ' cannot both be specified'\n );\n }\n for (const cellText of parameters.headerTitles) {\n this.header.addPlainTextCell(cellText);\n }\n } else if (parameters.headerCells) {\n for (const cell of parameters.headerCells) {\n this.header.addCell(cell);\n }\n }\n }\n\n if (rows) {\n for (const row of rows) {\n this.addRow(row);\n }\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.Table;\n }\n\n public get rows(): ReadonlyArray<DocTableRow> {\n return this._rows;\n }\n\n public addRow(row: DocTableRow): void {\n this._rows.push(row);\n }\n\n public createAndAddRow(): DocTableRow {\n const row: DocTableRow = new DocTableRow({ configuration: this.configuration });\n this.addRow(row);\n return row;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return [this.header, ...this._rows];\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { DocNode, DocSection } from '@microsoft/tsdoc';
|
|
4
|
+
import { CustomDocNodeKind } from './CustomDocNodeKind';
|
|
5
|
+
/**
|
|
6
|
+
* Represents table cell, similar to an HTML `<td>` element.
|
|
7
|
+
*/
|
|
8
|
+
export class DocTableCell extends DocNode {
|
|
9
|
+
constructor(parameters, sectionChildNodes) {
|
|
10
|
+
super(parameters);
|
|
11
|
+
this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);
|
|
12
|
+
}
|
|
13
|
+
/** @override */
|
|
14
|
+
get kind() {
|
|
15
|
+
return CustomDocNodeKind.TableCell;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DocTableCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocTableCell.js","sourceRoot":"","sources":["../../src/nodes/DocTableCell.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAA2B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO;IAGvC,YAAmB,UAAmC,EAAE,iBAA0C;QAChG,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC1F,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,iBAAiB,CAAC,SAAS,CAAC;IACrC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type IDocNodeParameters, DocNode, DocSection } from '@microsoft/tsdoc';\n\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\n\n/**\n * Constructor parameters for {@link DocTableCell}.\n */\nexport interface IDocTableCellParameters extends IDocNodeParameters {}\n\n/**\n * Represents table cell, similar to an HTML `<td>` element.\n */\nexport class DocTableCell extends DocNode {\n public readonly content: DocSection;\n\n public constructor(parameters: IDocTableCellParameters, sectionChildNodes?: ReadonlyArray<DocNode>) {\n super(parameters);\n\n this.content = new DocSection({ configuration: this.configuration }, sectionChildNodes);\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.TableCell;\n }\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { DocNode, DocPlainText } from '@microsoft/tsdoc';
|
|
4
|
+
import { CustomDocNodeKind } from './CustomDocNodeKind';
|
|
5
|
+
import { DocTableCell } from './DocTableCell';
|
|
6
|
+
/**
|
|
7
|
+
* Represents table row, similar to an HTML `<tr>` element.
|
|
8
|
+
*/
|
|
9
|
+
export class DocTableRow extends DocNode {
|
|
10
|
+
constructor(parameters, cells) {
|
|
11
|
+
super(parameters);
|
|
12
|
+
this._cells = [];
|
|
13
|
+
if (cells) {
|
|
14
|
+
for (const cell of cells) {
|
|
15
|
+
this.addCell(cell);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** @override */
|
|
20
|
+
get kind() {
|
|
21
|
+
return CustomDocNodeKind.TableRow;
|
|
22
|
+
}
|
|
23
|
+
get cells() {
|
|
24
|
+
return this._cells;
|
|
25
|
+
}
|
|
26
|
+
addCell(cell) {
|
|
27
|
+
this._cells.push(cell);
|
|
28
|
+
}
|
|
29
|
+
createAndAddCell() {
|
|
30
|
+
const newCell = new DocTableCell({ configuration: this.configuration });
|
|
31
|
+
this.addCell(newCell);
|
|
32
|
+
return newCell;
|
|
33
|
+
}
|
|
34
|
+
addPlainTextCell(cellContent) {
|
|
35
|
+
const cell = this.createAndAddCell();
|
|
36
|
+
cell.content.appendNodeInParagraph(new DocPlainText({
|
|
37
|
+
configuration: this.configuration,
|
|
38
|
+
text: cellContent
|
|
39
|
+
}));
|
|
40
|
+
return cell;
|
|
41
|
+
}
|
|
42
|
+
/** @override */
|
|
43
|
+
onGetChildNodes() {
|
|
44
|
+
return this._cells;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=DocTableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocTableRow.js","sourceRoot":"","sources":["../../src/nodes/DocTableRow.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAA2B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAO;IAGtC,YAAmB,UAAkC,EAAE,KAAmC;QACxF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,iBAAiB,CAAC,QAAQ,CAAC;IACpC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,OAAO,CAAC,IAAkB;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEM,gBAAgB;QACrB,MAAM,OAAO,GAAiB,IAAI,YAAY,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,gBAAgB,CAAC,WAAmB;QACzC,MAAM,IAAI,GAAiB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAChC,IAAI,YAAY,CAAC;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,IAAI,EAAE,WAAW;SAClB,CAAC,CACH,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type IDocNodeParameters, DocNode, DocPlainText } from '@microsoft/tsdoc';\n\nimport { CustomDocNodeKind } from './CustomDocNodeKind';\nimport { DocTableCell } from './DocTableCell';\n\n/**\n * Constructor parameters for {@link DocTableRow}.\n */\nexport interface IDocTableRowParameters extends IDocNodeParameters {}\n\n/**\n * Represents table row, similar to an HTML `<tr>` element.\n */\nexport class DocTableRow extends DocNode {\n private readonly _cells: DocTableCell[];\n\n public constructor(parameters: IDocTableRowParameters, cells?: ReadonlyArray<DocTableCell>) {\n super(parameters);\n\n this._cells = [];\n if (cells) {\n for (const cell of cells) {\n this.addCell(cell);\n }\n }\n }\n\n /** @override */\n public get kind(): string {\n return CustomDocNodeKind.TableRow;\n }\n\n public get cells(): ReadonlyArray<DocTableCell> {\n return this._cells;\n }\n\n public addCell(cell: DocTableCell): void {\n this._cells.push(cell);\n }\n\n public createAndAddCell(): DocTableCell {\n const newCell: DocTableCell = new DocTableCell({ configuration: this.configuration });\n this.addCell(newCell);\n return newCell;\n }\n\n public addPlainTextCell(cellContent: string): DocTableCell {\n const cell: DocTableCell = this.createAndAddCell();\n cell.content.appendNodeInParagraph(\n new DocPlainText({\n configuration: this.configuration,\n text: cellContent\n })\n );\n return cell;\n }\n\n /** @override */\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\n return this._cells;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IApiDocumenterPluginManifest.js","sourceRoot":"","sources":["../../src/plugin/IApiDocumenterPluginManifest.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { MarkdownDocumenterFeature } from './MarkdownDocumenterFeature';\nimport type { PluginFeatureInitialization } from './PluginFeature';\n\n/**\n * Defines a \"feature\" that is provided by an API Documenter plugin. A feature is a user-defined module\n * that customizes the behavior of API Documenter.\n *\n * @public\n */\nexport interface IFeatureDefinition {\n /**\n * The name of this feature, as it will appear in the config file.\n *\n * The name should consist of one or more words separated by hyphens. Each word should consist of lower case\n * letters and numbers. Example: `my-feature`\n */\n featureName: string;\n\n /**\n * Determines the kind of feature. The specified value is the name of the base class that `subclass` inherits from.\n *\n * @remarks\n * For now, `MarkdownDocumenterFeature` is the only supported value.\n */\n kind: 'MarkdownDocumenterFeature';\n\n /**\n * Your subclass that extends from the base class.\n */\n subclass: { new (initialization: PluginFeatureInitialization): MarkdownDocumenterFeature };\n}\n\n/**\n * The manifest for an API Documenter plugin.\n *\n * @remarks\n * An API documenter plugin is an NPM package. By convention, the NPM package name should have the prefix\n * `doc-plugin-`. Its main entry point should export an object named `apiDocumenterPluginManifest` which implements\n * the `IApiDocumenterPluginManifest` interface.\n *\n * For example:\n * ```ts\n * class MyMarkdownDocumenter extends MarkdownDocumenterFeature {\n * public onInitialized(): void {\n * console.log('MyMarkdownDocumenter: onInitialized()');\n * }\n * }\n *\n * export const apiDocumenterPluginManifest: IApiDocumenterPluginManifest = {\n * manifestVersion: 1000,\n * features: [\n * {\n * featureName: 'my-markdown-documenter',\n * kind: 'MarkdownDocumenterFeature',\n * subclass: MyMarkdownDocumenter\n * }\n * ]\n * };\n * ```\n * @public\n */\nexport interface IApiDocumenterPluginManifest {\n /**\n * The manifest version number. For now, this must always be `1000`.\n */\n manifestVersion: 1000;\n\n /**\n * The list of features provided by this plugin.\n */\n features: IFeatureDefinition[];\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to the documenter that is generating the output.
|
|
5
|
+
*
|
|
6
|
+
* @privateRemarks
|
|
7
|
+
* This class is wrapper that provides access to the underlying MarkdownDocumenter, while hiding the implementation
|
|
8
|
+
* details to ensure that the plugin API contract is stable.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export class MarkdownDocumenterAccessor {
|
|
13
|
+
/** @internal */
|
|
14
|
+
constructor(implementation) {
|
|
15
|
+
this._implementation = implementation;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* For a given `ApiItem`, return its markdown hyperlink.
|
|
19
|
+
*
|
|
20
|
+
* @returns The hyperlink, or `undefined` if the `ApiItem` object does not have a hyperlink.
|
|
21
|
+
*/
|
|
22
|
+
getLinkForApiItem(apiItem) {
|
|
23
|
+
return this._implementation.getLinkForApiItem(apiItem);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=MarkdownDocumenterAccessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownDocumenterAccessor.js","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterAccessor.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAS3D;;;;;;;;GAQG;AACH,MAAM,OAAO,0BAA0B;IAGrC,gBAAgB;IAChB,YAAmB,cAAyD;QAC1E,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,iBAAiB,CAAC,OAAgB;QACvC,OAAO,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ApiItem } from '@microsoft/api-extractor-model';\n\n/** @internal */\nexport interface IMarkdownDocumenterAccessorImplementation {\n getLinkForApiItem(apiItem: ApiItem): string | undefined;\n}\n\n/**\n * Provides access to the documenter that is generating the output.\n *\n * @privateRemarks\n * This class is wrapper that provides access to the underlying MarkdownDocumenter, while hiding the implementation\n * details to ensure that the plugin API contract is stable.\n *\n * @public\n */\nexport class MarkdownDocumenterAccessor {\n private _implementation: IMarkdownDocumenterAccessorImplementation;\n\n /** @internal */\n public constructor(implementation: IMarkdownDocumenterAccessorImplementation) {\n this._implementation = implementation;\n }\n\n /**\n * For a given `ApiItem`, return its markdown hyperlink.\n *\n * @returns The hyperlink, or `undefined` if the `ApiItem` object does not have a hyperlink.\n */\n public getLinkForApiItem(apiItem: ApiItem): string | undefined {\n return this._implementation.getLinkForApiItem(apiItem);\n }\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { TypeUuid } from '@rushstack/node-core-library';
|
|
4
|
+
import { PluginFeature } from './PluginFeature';
|
|
5
|
+
/**
|
|
6
|
+
* Context object for {@link MarkdownDocumenterFeature}.
|
|
7
|
+
* Exposes various services that can be used by a plugin.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export class MarkdownDocumenterFeatureContext {
|
|
12
|
+
/** @internal */
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.apiModel = options.apiModel;
|
|
15
|
+
this.outputFolder = options.outputFolder;
|
|
16
|
+
this.documenter = options.documenter;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const uuidMarkdownDocumenterFeature = '34196154-9eb3-4de0-a8c8-7e9539dfe216';
|
|
20
|
+
/**
|
|
21
|
+
* Inherit from this base class to implement an API Documenter plugin feature that customizes
|
|
22
|
+
* the generation of markdown output.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export class MarkdownDocumenterFeature extends PluginFeature {
|
|
27
|
+
/**
|
|
28
|
+
* This event occurs before each markdown file is written. It provides an opportunity to customize the
|
|
29
|
+
* content of the file.
|
|
30
|
+
* @virtual
|
|
31
|
+
*/
|
|
32
|
+
onBeforeWritePage(eventArgs) {
|
|
33
|
+
// (implemented by child class)
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* This event occurs after all output files have been written.
|
|
37
|
+
* @virtual
|
|
38
|
+
*/
|
|
39
|
+
onFinished(eventArgs) {
|
|
40
|
+
// (implemented by child class)
|
|
41
|
+
}
|
|
42
|
+
static [Symbol.hasInstance](instance) {
|
|
43
|
+
return TypeUuid.isInstanceOf(instance, uuidMarkdownDocumenterFeature);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
TypeUuid.registerClass(MarkdownDocumenterFeature, uuidMarkdownDocumenterFeature);
|
|
47
|
+
//# sourceMappingURL=MarkdownDocumenterFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownDocumenterFeature.js","sourceRoot":"","sources":["../../src/plugin/MarkdownDocumenterFeature.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAG3D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;;GAKG;AACH,MAAM,OAAO,gCAAgC;IAgB3C,gBAAgB;IAChB,YAAmB,OAAyC;QAC1D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACvC,CAAC;CACF;AA8BD,MAAM,6BAA6B,GAAW,sCAAsC,CAAC;AAErF;;;;;GAKG;AACH,MAAM,OAAO,yBAA0B,SAAQ,aAAa;IAI1D;;;;OAIG;IACI,iBAAiB,CAAC,SAA0D;QACjF,+BAA+B;IACjC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,SAAmD;QACnE,+BAA+B;IACjC,CAAC;IAEM,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAgB;QACjD,OAAO,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;IACxE,CAAC;CACF;AAED,QAAQ,CAAC,aAAa,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';\nimport { TypeUuid } from '@rushstack/node-core-library';\n\nimport { PluginFeature } from './PluginFeature';\nimport type { MarkdownDocumenterAccessor } from './MarkdownDocumenterAccessor';\n\n/**\n * Context object for {@link MarkdownDocumenterFeature}.\n * Exposes various services that can be used by a plugin.\n *\n * @public\n */\nexport class MarkdownDocumenterFeatureContext {\n /**\n * Provides access to the `ApiModel` for the documentation being generated.\n */\n public readonly apiModel: ApiModel;\n\n /**\n * The full path to the output folder.\n */\n public readonly outputFolder: string;\n\n /**\n * Exposes functionality of the documenter.\n */\n public readonly documenter: MarkdownDocumenterAccessor;\n\n /** @internal */\n public constructor(options: MarkdownDocumenterFeatureContext) {\n this.apiModel = options.apiModel;\n this.outputFolder = options.outputFolder;\n this.documenter = options.documenter;\n }\n}\n\n/**\n * Event arguments for MarkdownDocumenterFeature.onBeforeWritePage()\n * @public\n */\nexport interface IMarkdownDocumenterFeatureOnBeforeWritePageArgs {\n /**\n * The API item corresponding to this page.\n */\n readonly apiItem: ApiItem;\n\n /**\n * The page content. The {@link MarkdownDocumenterFeature.onBeforeWritePage} handler can reassign this\n * string to customize the page appearance.\n */\n pageContent: string;\n\n /**\n * The filename where the output will be written.\n */\n readonly outputFilename: string;\n}\n\n/**\n * Event arguments for MarkdownDocumenterFeature.onFinished()\n * @public\n */\nexport interface IMarkdownDocumenterFeatureOnFinishedArgs {}\n\nconst uuidMarkdownDocumenterFeature: string = '34196154-9eb3-4de0-a8c8-7e9539dfe216';\n\n/**\n * Inherit from this base class to implement an API Documenter plugin feature that customizes\n * the generation of markdown output.\n *\n * @public\n */\nexport class MarkdownDocumenterFeature extends PluginFeature {\n /** {@inheritdoc PluginFeature.context} */\n public context!: MarkdownDocumenterFeatureContext;\n\n /**\n * This event occurs before each markdown file is written. It provides an opportunity to customize the\n * content of the file.\n * @virtual\n */\n public onBeforeWritePage(eventArgs: IMarkdownDocumenterFeatureOnBeforeWritePageArgs): void {\n // (implemented by child class)\n }\n\n /**\n * This event occurs after all output files have been written.\n * @virtual\n */\n public onFinished(eventArgs: IMarkdownDocumenterFeatureOnFinishedArgs): void {\n // (implemented by child class)\n }\n\n public static [Symbol.hasInstance](instance: object): boolean {\n return TypeUuid.isInstanceOf(instance, uuidMarkdownDocumenterFeature);\n }\n}\n\nTypeUuid.registerClass(MarkdownDocumenterFeature, uuidMarkdownDocumenterFeature);\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { TypeUuid } from '@rushstack/node-core-library';
|
|
4
|
+
/**
|
|
5
|
+
* This is an internal part of the plugin infrastructure.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This object is the constructor parameter for API Documenter plugin features.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export class PluginFeatureInitialization {
|
|
13
|
+
/** @internal */
|
|
14
|
+
constructor() {
|
|
15
|
+
// reserved for future use
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Context object for {@link PluginFeature}.
|
|
20
|
+
* Exposes various services that can be used by a plugin.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export class PluginFeatureContext {
|
|
25
|
+
}
|
|
26
|
+
const uuidPluginFeature = '56876472-7134-4812-819e-533de0ee10e6';
|
|
27
|
+
/**
|
|
28
|
+
* The abstract base class for all API Documenter plugin features.
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export class PluginFeature {
|
|
32
|
+
/**
|
|
33
|
+
* The subclass should pass the `initialization` through to the base class.
|
|
34
|
+
* Do not put custom initialization code in the constructor. Instead perform your initialization in the
|
|
35
|
+
* `onInitialized()` event function.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
constructor(initialization) {
|
|
39
|
+
// reserved for future expansion
|
|
40
|
+
this.context = initialization._context;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* This event function is called after the feature is initialized, but before any processing occurs.
|
|
44
|
+
* @virtual
|
|
45
|
+
*/
|
|
46
|
+
onInitialized() {
|
|
47
|
+
// (implemented by child class)
|
|
48
|
+
}
|
|
49
|
+
static [Symbol.hasInstance](instance) {
|
|
50
|
+
return TypeUuid.isInstanceOf(instance, uuidPluginFeature);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
TypeUuid.registerClass(PluginFeature, uuidPluginFeature);
|
|
54
|
+
//# sourceMappingURL=PluginFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginFeature.js","sourceRoot":"","sources":["../../src/plugin/PluginFeature.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,OAAO,2BAA2B;IAItC,gBAAgB;IAChB;QACE,0BAA0B;IAC5B,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;CAAG;AAEpC,MAAM,iBAAiB,GAAW,sCAAsC,CAAC;AAEzE;;;GAGG;AACH,MAAM,OAAgB,aAAa;IAMjC;;;;;OAKG;IACH,YAAmB,cAA2C;QAC5D,gCAAgC;QAChC,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,aAAa;QAClB,+BAA+B;IACjC,CAAC;IAEM,MAAM,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAgB;QACjD,OAAO,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;CACF;AAED,QAAQ,CAAC,aAAa,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { TypeUuid } from '@rushstack/node-core-library';\n\n/**\n * This is an internal part of the plugin infrastructure.\n *\n * @remarks\n * This object is the constructor parameter for API Documenter plugin features.\n *\n * @public\n */\nexport class PluginFeatureInitialization {\n /** @internal */\n public _context!: PluginFeatureContext;\n\n /** @internal */\n public constructor() {\n // reserved for future use\n }\n}\n\n/**\n * Context object for {@link PluginFeature}.\n * Exposes various services that can be used by a plugin.\n *\n * @public\n */\nexport class PluginFeatureContext {}\n\nconst uuidPluginFeature: string = '56876472-7134-4812-819e-533de0ee10e6';\n\n/**\n * The abstract base class for all API Documenter plugin features.\n * @public\n */\nexport abstract class PluginFeature {\n /**\n * Exposes various services that can be used by a plugin.\n */\n public context: PluginFeatureContext;\n\n /**\n * The subclass should pass the `initialization` through to the base class.\n * Do not put custom initialization code in the constructor. Instead perform your initialization in the\n * `onInitialized()` event function.\n * @internal\n */\n public constructor(initialization: PluginFeatureInitialization) {\n // reserved for future expansion\n this.context = initialization._context;\n }\n\n /**\n * This event function is called after the feature is initialized, but before any processing occurs.\n * @virtual\n */\n public onInitialized(): void {\n // (implemented by child class)\n }\n\n public static [Symbol.hasInstance](instance: object): boolean {\n return TypeUuid.isInstanceOf(instance, uuidPluginFeature);\n }\n}\n\nTypeUuid.registerClass(PluginFeature, uuidPluginFeature);\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import * as resolve from 'resolve';
|
|
5
|
+
import { MarkdownDocumenterFeature } from './MarkdownDocumenterFeature';
|
|
6
|
+
import { PluginFeatureInitialization } from './PluginFeature';
|
|
7
|
+
export class PluginLoader {
|
|
8
|
+
load(documenterConfig, createContext) {
|
|
9
|
+
const configFileFolder = path.dirname(documenterConfig.configFilePath);
|
|
10
|
+
for (const configPlugin of documenterConfig.configFile.plugins || []) {
|
|
11
|
+
try {
|
|
12
|
+
// Look for the package name in the same place as the config file
|
|
13
|
+
const resolvedEntryPointPath = resolve.sync(configPlugin.packageName, {
|
|
14
|
+
basedir: configFileFolder
|
|
15
|
+
});
|
|
16
|
+
// Load the package
|
|
17
|
+
const entryPoint = require(resolvedEntryPointPath);
|
|
18
|
+
if (!entryPoint) {
|
|
19
|
+
throw new Error('Invalid entry point');
|
|
20
|
+
}
|
|
21
|
+
if (!entryPoint.apiDocumenterPluginManifest) {
|
|
22
|
+
throw new Error(`The package is not an API documenter plugin;` +
|
|
23
|
+
` the "apiDocumenterPluginManifest" export was not found`);
|
|
24
|
+
}
|
|
25
|
+
const manifest = entryPoint.apiDocumenterPluginManifest;
|
|
26
|
+
if (manifest.manifestVersion !== 1000) {
|
|
27
|
+
throw new Error(`The plugin is not compatible with this version of API Documenter;` +
|
|
28
|
+
` unsupported manifestVersion`);
|
|
29
|
+
}
|
|
30
|
+
const loadedPlugin = {
|
|
31
|
+
packageName: configPlugin.packageName,
|
|
32
|
+
manifest
|
|
33
|
+
};
|
|
34
|
+
const featureDefinitionsByName = new Map();
|
|
35
|
+
for (const featureDefinition of manifest.features) {
|
|
36
|
+
featureDefinitionsByName.set(featureDefinition.featureName, featureDefinition);
|
|
37
|
+
}
|
|
38
|
+
for (const featureName of configPlugin.enabledFeatureNames) {
|
|
39
|
+
const featureDefinition = featureDefinitionsByName.get(featureName);
|
|
40
|
+
if (!featureDefinition) {
|
|
41
|
+
throw new Error(`The plugin ${loadedPlugin.packageName} does not have a feature with name "${featureName}"`);
|
|
42
|
+
}
|
|
43
|
+
if (featureDefinition.kind === 'MarkdownDocumenterFeature') {
|
|
44
|
+
if (this.markdownDocumenterFeature) {
|
|
45
|
+
throw new Error('A MarkdownDocumenterFeature is already loaded');
|
|
46
|
+
}
|
|
47
|
+
const initialization = new PluginFeatureInitialization();
|
|
48
|
+
initialization._context = createContext();
|
|
49
|
+
let markdownDocumenterFeature = undefined;
|
|
50
|
+
try {
|
|
51
|
+
markdownDocumenterFeature = new featureDefinition.subclass(initialization);
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
throw new Error(`Failed to construct feature subclass:\n` + e.toString());
|
|
55
|
+
}
|
|
56
|
+
if (!(markdownDocumenterFeature instanceof MarkdownDocumenterFeature)) {
|
|
57
|
+
throw new Error('The constructed subclass was not an instance of MarkdownDocumenterFeature');
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
markdownDocumenterFeature.onInitialized();
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
throw new Error('Error occurred during the onInitialized() event: ' + e.toString());
|
|
64
|
+
}
|
|
65
|
+
this.markdownDocumenterFeature = markdownDocumenterFeature;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
throw new Error(`Unknown feature definition kind: "${featureDefinition.kind}"`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
throw new Error(`Error loading plugin ${configPlugin.packageName}: ` + e.message);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=PluginLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginLoader.js","sourceRoot":"","sources":["../../src/plugin/PluginLoader.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EACL,yBAAyB,EAE1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAQ9D,MAAM,OAAO,YAAY;IAGhB,IAAI,CACT,gBAAkC,EAClC,aAAqD;QAErD,MAAM,gBAAgB,GAAW,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAC/E,KAAK,MAAM,YAAY,IAAI,gBAAgB,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;YACrE,IAAI,CAAC;gBACH,iEAAiE;gBACjE,MAAM,sBAAsB,GAAW,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE;oBAC5E,OAAO,EAAE,gBAAgB;iBAC1B,CAAC,CAAC;gBAEH,mBAAmB;gBACnB,MAAM,UAAU,GAEA,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBAEhD,IAAI,CAAC,UAAU,EAAE,CAAC;oBAChB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;gBACzC,CAAC;gBAED,IAAI,CAAC,UAAU,CAAC,2BAA2B,EAAE,CAAC;oBAC5C,MAAM,IAAI,KAAK,CACb,8CAA8C;wBAC5C,yDAAyD,CAC5D,CAAC;gBACJ,CAAC;gBAED,MAAM,QAAQ,GAAiC,UAAU,CAAC,2BAA2B,CAAC;gBAEtF,IAAI,QAAQ,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;oBACtC,MAAM,IAAI,KAAK,CACb,mEAAmE;wBACjE,8BAA8B,CACjC,CAAC;gBACJ,CAAC;gBAED,MAAM,YAAY,GAAkB;oBAClC,WAAW,EAAE,YAAY,CAAC,WAAW;oBACrC,QAAQ;iBACT,CAAC;gBAEF,MAAM,wBAAwB,GAAoC,IAAI,GAAG,EAGtE,CAAC;gBACJ,KAAK,MAAM,iBAAiB,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;oBAClD,wBAAwB,CAAC,GAAG,CAAC,iBAAiB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;gBACjF,CAAC;gBAED,KAAK,MAAM,WAAW,IAAI,YAAY,CAAC,mBAAmB,EAAE,CAAC;oBAC3D,MAAM,iBAAiB,GAAmC,wBAAwB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;oBACpG,IAAI,CAAC,iBAAiB,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CACb,cAAc,YAAY,CAAC,WAAW,uCAAuC,WAAW,GAAG,CAC5F,CAAC;oBACJ,CAAC;oBAED,IAAI,iBAAiB,CAAC,IAAI,KAAK,2BAA2B,EAAE,CAAC;wBAC3D,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC;4BACnC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;wBACnE,CAAC;wBAED,MAAM,cAAc,GAAgC,IAAI,2BAA2B,EAAE,CAAC;wBACtF,cAAc,CAAC,QAAQ,GAAG,aAAa,EAAE,CAAC;wBAE1C,IAAI,yBAAyB,GAA0C,SAAS,CAAC;wBACjF,IAAI,CAAC;4BACH,yBAAyB,GAAG,IAAI,iBAAiB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;wBAC7E,CAAC;wBAAC,OAAO,CAAC,EAAE,CAAC;4BACX,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAI,CAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;wBACvF,CAAC;wBACD,IAAI,CAAC,CAAC,yBAAyB,YAAY,yBAAyB,CAAC,EAAE,CAAC;4BACtE,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;wBAC/F,CAAC;wBAED,IAAI,CAAC;4BACH,yBAAyB,CAAC,aAAa,EAAE,CAAC;wBAC5C,CAAC;wBAAC,OAAO,CAAC,EAAE,CAAC;4BACX,MAAM,IAAI,KAAK,CAAC,mDAAmD,GAAI,CAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;wBACjG,CAAC;wBAED,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;oBAC7D,CAAC;yBAAM,CAAC;wBACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,iBAAiB,CAAC,IAAI,GAAG,CAAC,CAAC;oBAClF,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,IAAI,KAAK,CAAC,wBAAwB,YAAY,CAAC,WAAW,IAAI,GAAI,CAAW,CAAC,OAAO,CAAC,CAAC;YAC/F,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'node:path';\n\nimport * as resolve from 'resolve';\n\nimport type { IApiDocumenterPluginManifest, IFeatureDefinition } from './IApiDocumenterPluginManifest';\nimport {\n MarkdownDocumenterFeature,\n type MarkdownDocumenterFeatureContext\n} from './MarkdownDocumenterFeature';\nimport { PluginFeatureInitialization } from './PluginFeature';\nimport type { DocumenterConfig } from '../documenters/DocumenterConfig';\n\ninterface ILoadedPlugin {\n packageName: string;\n manifest: IApiDocumenterPluginManifest;\n}\n\nexport class PluginLoader {\n public markdownDocumenterFeature: MarkdownDocumenterFeature | undefined;\n\n public load(\n documenterConfig: DocumenterConfig,\n createContext: () => MarkdownDocumenterFeatureContext\n ): void {\n const configFileFolder: string = path.dirname(documenterConfig.configFilePath);\n for (const configPlugin of documenterConfig.configFile.plugins || []) {\n try {\n // Look for the package name in the same place as the config file\n const resolvedEntryPointPath: string = resolve.sync(configPlugin.packageName, {\n basedir: configFileFolder\n });\n\n // Load the package\n const entryPoint:\n | { apiDocumenterPluginManifest?: IApiDocumenterPluginManifest }\n | undefined = require(resolvedEntryPointPath);\n\n if (!entryPoint) {\n throw new Error('Invalid entry point');\n }\n\n if (!entryPoint.apiDocumenterPluginManifest) {\n throw new Error(\n `The package is not an API documenter plugin;` +\n ` the \"apiDocumenterPluginManifest\" export was not found`\n );\n }\n\n const manifest: IApiDocumenterPluginManifest = entryPoint.apiDocumenterPluginManifest;\n\n if (manifest.manifestVersion !== 1000) {\n throw new Error(\n `The plugin is not compatible with this version of API Documenter;` +\n ` unsupported manifestVersion`\n );\n }\n\n const loadedPlugin: ILoadedPlugin = {\n packageName: configPlugin.packageName,\n manifest\n };\n\n const featureDefinitionsByName: Map<string, IFeatureDefinition> = new Map<\n string,\n IFeatureDefinition\n >();\n for (const featureDefinition of manifest.features) {\n featureDefinitionsByName.set(featureDefinition.featureName, featureDefinition);\n }\n\n for (const featureName of configPlugin.enabledFeatureNames) {\n const featureDefinition: IFeatureDefinition | undefined = featureDefinitionsByName.get(featureName);\n if (!featureDefinition) {\n throw new Error(\n `The plugin ${loadedPlugin.packageName} does not have a feature with name \"${featureName}\"`\n );\n }\n\n if (featureDefinition.kind === 'MarkdownDocumenterFeature') {\n if (this.markdownDocumenterFeature) {\n throw new Error('A MarkdownDocumenterFeature is already loaded');\n }\n\n const initialization: PluginFeatureInitialization = new PluginFeatureInitialization();\n initialization._context = createContext();\n\n let markdownDocumenterFeature: MarkdownDocumenterFeature | undefined = undefined;\n try {\n markdownDocumenterFeature = new featureDefinition.subclass(initialization);\n } catch (e) {\n throw new Error(`Failed to construct feature subclass:\\n` + (e as Error).toString());\n }\n if (!(markdownDocumenterFeature instanceof MarkdownDocumenterFeature)) {\n throw new Error('The constructed subclass was not an instance of MarkdownDocumenterFeature');\n }\n\n try {\n markdownDocumenterFeature.onInitialized();\n } catch (e) {\n throw new Error('Error occurred during the onInitialized() event: ' + (e as Error).toString());\n }\n\n this.markdownDocumenterFeature = markdownDocumenterFeature;\n } else {\n throw new Error(`Unknown feature definition kind: \"${featureDefinition.kind}\"`);\n }\n }\n } catch (e) {\n throw new Error(`Error loading plugin ${configPlugin.packageName}: ` + (e as Error).message);\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config file for API Documenter. For more info, please visit: https://api-extractor.com
|
|
3
|
+
*/
|
|
4
|
+
{
|
|
5
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-documenter.schema.json",
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Specifies the output target.
|
|
9
|
+
* Supported values are "docfx" or "markdown"
|
|
10
|
+
*/
|
|
11
|
+
// "outputTarget": "markdown",
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Specifies what type of newlines API Documenter should use when writing output files. By default, the output files
|
|
15
|
+
* will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead.
|
|
16
|
+
* To use the OS's default newline kind, specify "os".
|
|
17
|
+
*
|
|
18
|
+
* DEFAULT VALUE: "crlf"
|
|
19
|
+
*/
|
|
20
|
+
// "newlineKind": "crlf",
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This enables an experimental feature that will be officially released with the next major version
|
|
24
|
+
* of API Documenter. It requires DocFX 2.46 or newer. It enables documentation for namespaces and
|
|
25
|
+
* adds them to the table of contents. This will also affect file layout as namespaced items will be nested
|
|
26
|
+
* under a directory for the namespace instead of just within the package.
|
|
27
|
+
*
|
|
28
|
+
* This setting currently only affects the 'docfx' output target. It is equivalent to the `--new-docfx-namespaces`
|
|
29
|
+
* command-line parameter.
|
|
30
|
+
*/
|
|
31
|
+
// "newDocfxNamespaces": false,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Describes plugin packages to be loaded, and which features to enable.
|
|
35
|
+
*/
|
|
36
|
+
"plugins": [
|
|
37
|
+
// {
|
|
38
|
+
// "packageName": "doc-plugin-example",
|
|
39
|
+
// "enabledFeatureNames": [ "example-feature" ]
|
|
40
|
+
// }
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Configures how the table of contents is generated.
|
|
45
|
+
*/
|
|
46
|
+
"tableOfContents": {
|
|
47
|
+
/**
|
|
48
|
+
* Allows hand-coded items to be injected into the table of contents.
|
|
49
|
+
*
|
|
50
|
+
* DEFAULT VALUE: (none)
|
|
51
|
+
*/
|
|
52
|
+
// "items": [
|
|
53
|
+
// { "name": "Example Node", "href": "~/homepage/homepage.md" },
|
|
54
|
+
// {
|
|
55
|
+
// "name": "API Reference",
|
|
56
|
+
// "items": [
|
|
57
|
+
// { "name": "References" }
|
|
58
|
+
// ]
|
|
59
|
+
// }
|
|
60
|
+
// ],
|
|
61
|
+
/**
|
|
62
|
+
* Optional category name that is recommended to include in the `tocConfig`,
|
|
63
|
+
* along with one of the filters: `filterByApiItemName` or `filterByInlineTag`.
|
|
64
|
+
* Any items that are not matched to the mentioned filters will be placed under this
|
|
65
|
+
* catchAll category. If none provided the items will not be included in the final toc.yml file.
|
|
66
|
+
*
|
|
67
|
+
* DEFAULT VALUE: (none)
|
|
68
|
+
*/
|
|
69
|
+
// "catchAllCategory": "References",
|
|
70
|
+
/**
|
|
71
|
+
* When loading more than one api.json files that might include the same API items,
|
|
72
|
+
* toggle either to show duplicates or not.
|
|
73
|
+
*
|
|
74
|
+
* DEFAULT VALUE: false
|
|
75
|
+
*/
|
|
76
|
+
// "noDuplicateEntries": true,
|
|
77
|
+
/**
|
|
78
|
+
* Toggle either sorting of the API items should be made based on category name presence
|
|
79
|
+
* in the API item's name.
|
|
80
|
+
*
|
|
81
|
+
* DEFAULT VALUE: false
|
|
82
|
+
*/
|
|
83
|
+
// "filterByApiItemName": false,
|
|
84
|
+
/**
|
|
85
|
+
* Filter that can be used to sort the API items according to an inline custom tag
|
|
86
|
+
* that is present on them.
|
|
87
|
+
*
|
|
88
|
+
* DEFAULT VALUE: (none)
|
|
89
|
+
*/
|
|
90
|
+
// "filterByInlineTag": "@docCategory"
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Specifies whether inherited members should also be shown on an API item's page.
|
|
95
|
+
*
|
|
96
|
+
* DEFAULT VALUE: false
|
|
97
|
+
*/
|
|
98
|
+
// "showInheritedMembers": false
|
|
99
|
+
}
|