@firebase/api-documenter 0.1.2-canary.233e117f0
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.md +10 -0
- package/README.md +16 -0
- package/dist/cli/ApiDocumenterCommandLine.d.ts +22 -0
- package/dist/cli/ApiDocumenterCommandLine.js +44 -0
- package/dist/cli/ApiDocumenterCommandLine.js.map +1 -0
- package/dist/cli/BaseAction.d.ts +37 -0
- package/dist/cli/BaseAction.js +125 -0
- package/dist/cli/BaseAction.js.map +1 -0
- package/dist/cli/MarkdownAction.d.ts +22 -0
- package/dist/cli/MarkdownAction.js +47 -0
- package/dist/cli/MarkdownAction.js.map +1 -0
- package/dist/cli/TocAction.d.ts +25 -0
- package/dist/cli/TocAction.js +67 -0
- package/dist/cli/TocAction.js.map +1 -0
- package/dist/documenters/DocumenterConfig.d.ts +45 -0
- package/dist/documenters/DocumenterConfig.js +63 -0
- package/dist/documenters/DocumenterConfig.js.map +1 -0
- package/dist/documenters/IConfigFile.d.ts +98 -0
- package/dist/documenters/IConfigFile.js +19 -0
- package/dist/documenters/IConfigFile.js.map +1 -0
- package/dist/documenters/MarkdownDocumenter.d.ts +75 -0
- package/dist/documenters/MarkdownDocumenter.js +750 -0
- package/dist/documenters/MarkdownDocumenter.js.map +1 -0
- package/dist/documenters/MarkdownDocumenterHelpers.d.ts +40 -0
- package/dist/documenters/MarkdownDocumenterHelpers.js +306 -0
- package/dist/documenters/MarkdownDocumenterHelpers.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown/CustomMarkdownEmitter.d.ts +32 -0
- package/dist/markdown/CustomMarkdownEmitter.js +161 -0
- package/dist/markdown/CustomMarkdownEmitter.js.map +1 -0
- package/dist/markdown/MarkdownEmitter.d.ts +48 -0
- package/dist/markdown/MarkdownEmitter.js +243 -0
- package/dist/markdown/MarkdownEmitter.js.map +1 -0
- package/dist/markdown/test/CustomMarkdownEmitter.test.d.ts +17 -0
- package/dist/markdown/test/CustomMarkdownEmitter.test.js +205 -0
- package/dist/markdown/test/CustomMarkdownEmitter.test.js.map +1 -0
- package/dist/nodes/CustomDocNodeKind.d.ts +32 -0
- package/dist/nodes/CustomDocNodeKind.js +58 -0
- package/dist/nodes/CustomDocNodeKind.js.map +1 -0
- package/dist/nodes/DocEmphasisSpan.d.ts +35 -0
- package/dist/nodes/DocEmphasisSpan.js +39 -0
- package/dist/nodes/DocEmphasisSpan.js.map +1 -0
- package/dist/nodes/DocHeading.d.ts +38 -0
- package/dist/nodes/DocHeading.js +45 -0
- package/dist/nodes/DocHeading.js.map +1 -0
- package/dist/nodes/DocNoteBox.d.ts +33 -0
- package/dist/nodes/DocNoteBox.js +41 -0
- package/dist/nodes/DocNoteBox.js.map +1 -0
- package/dist/nodes/DocTable.d.ts +41 -0
- package/dist/nodes/DocTable.js +77 -0
- package/dist/nodes/DocTable.js.map +1 -0
- package/dist/nodes/DocTableCell.d.ts +31 -0
- package/dist/nodes/DocTableCell.js +37 -0
- package/dist/nodes/DocTableCell.js.map +1 -0
- package/dist/nodes/DocTableRow.d.ts +38 -0
- package/dist/nodes/DocTableRow.js +68 -0
- package/dist/nodes/DocTableRow.js.map +1 -0
- package/dist/plugin/IApiDocumenterPluginManifest.d.ts +85 -0
- package/dist/plugin/IApiDocumenterPluginManifest.js +19 -0
- package/dist/plugin/IApiDocumenterPluginManifest.js.map +1 -0
- package/dist/plugin/MarkdownDocumenterAccessor.d.ts +41 -0
- package/dist/plugin/MarkdownDocumenterAccessor.js +44 -0
- package/dist/plugin/MarkdownDocumenterAccessor.js.map +1 -0
- package/dist/plugin/MarkdownDocumenterFeature.d.ts +88 -0
- package/dist/plugin/MarkdownDocumenterFeature.js +66 -0
- package/dist/plugin/MarkdownDocumenterFeature.js.map +1 -0
- package/dist/plugin/PluginFeature.d.ts +61 -0
- package/dist/plugin/PluginFeature.js +76 -0
- package/dist/plugin/PluginFeature.js.map +1 -0
- package/dist/plugin/PluginLoader.d.ts +22 -0
- package/dist/plugin/PluginLoader.js +100 -0
- package/dist/plugin/PluginLoader.js.map +1 -0
- package/dist/schemas/api-documenter-template.json +92 -0
- package/dist/schemas/api-documenter.schema.json +42 -0
- package/dist/start.d.ts +18 -0
- package/dist/start.js +32 -0
- package/dist/start.js.map +1 -0
- package/dist/toc.d.ts +25 -0
- package/dist/toc.js +61 -0
- package/dist/toc.js.map +1 -0
- package/dist/utils/IndentedWriter.d.ts +116 -0
- package/dist/utils/IndentedWriter.js +213 -0
- package/dist/utils/IndentedWriter.js.map +1 -0
- package/dist/utils/Utilities.d.ts +28 -0
- package/dist/utils/Utilities.js +47 -0
- package/dist/utils/Utilities.js.map +1 -0
- package/dist/utils/test/IndentedWriter.test.d.ts +17 -0
- package/dist/utils/test/IndentedWriter.test.js +87 -0
- package/dist/utils/test/IndentedWriter.test.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2020 Google LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.CustomMarkdownEmitter = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
22
|
+
// See LICENSE in the project root for license information.
|
|
23
|
+
const colors_1 = tslib_1.__importDefault(require("colors"));
|
|
24
|
+
const MarkdownEmitter_1 = require("./MarkdownEmitter");
|
|
25
|
+
class CustomMarkdownEmitter extends MarkdownEmitter_1.MarkdownEmitter {
|
|
26
|
+
constructor(apiModel) {
|
|
27
|
+
super();
|
|
28
|
+
this._apiModel = apiModel;
|
|
29
|
+
}
|
|
30
|
+
emit(stringBuilder, docNode, options) {
|
|
31
|
+
return super.emit(stringBuilder, docNode, options);
|
|
32
|
+
}
|
|
33
|
+
/** @override */
|
|
34
|
+
writeNode(docNode, context, docNodeSiblings) {
|
|
35
|
+
const writer = context.writer;
|
|
36
|
+
switch (docNode.kind) {
|
|
37
|
+
case "Heading" /* Heading */: {
|
|
38
|
+
const docHeading = docNode;
|
|
39
|
+
writer.ensureSkippedLine();
|
|
40
|
+
let prefix;
|
|
41
|
+
switch (docHeading.level) {
|
|
42
|
+
case 1:
|
|
43
|
+
prefix = '##';
|
|
44
|
+
break;
|
|
45
|
+
case 2:
|
|
46
|
+
prefix = '###';
|
|
47
|
+
break;
|
|
48
|
+
case 3:
|
|
49
|
+
prefix = '###';
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
prefix = '####';
|
|
53
|
+
}
|
|
54
|
+
writer.writeLine(prefix + ' ' + this.getEscapedText(docHeading.title));
|
|
55
|
+
writer.writeLine();
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case "NoteBox" /* NoteBox */: {
|
|
59
|
+
const docNoteBox = docNode;
|
|
60
|
+
writer.ensureNewLine();
|
|
61
|
+
writer.increaseIndent('> ');
|
|
62
|
+
this.writeNode(docNoteBox.content, context, false);
|
|
63
|
+
writer.ensureNewLine();
|
|
64
|
+
writer.decreaseIndent();
|
|
65
|
+
writer.writeLine();
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case "Table" /* Table */: {
|
|
69
|
+
const docTable = docNode;
|
|
70
|
+
// GitHub's markdown renderer chokes on tables that don't have a blank line above them,
|
|
71
|
+
// whereas VS Code's renderer is totally fine with it.
|
|
72
|
+
writer.ensureSkippedLine();
|
|
73
|
+
context.insideTable = true;
|
|
74
|
+
// Markdown table rows can have inconsistent cell counts. Size the table based on the longest row.
|
|
75
|
+
let columnCount = 0;
|
|
76
|
+
if (docTable.header) {
|
|
77
|
+
columnCount = docTable.header.cells.length;
|
|
78
|
+
}
|
|
79
|
+
for (const row of docTable.rows) {
|
|
80
|
+
if (row.cells.length > columnCount) {
|
|
81
|
+
columnCount = row.cells.length;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// write the table header (which is required by Markdown)
|
|
85
|
+
writer.write('| ');
|
|
86
|
+
for (let i = 0; i < columnCount; ++i) {
|
|
87
|
+
writer.write(' ');
|
|
88
|
+
if (docTable.header) {
|
|
89
|
+
const cell = docTable.header.cells[i];
|
|
90
|
+
if (cell) {
|
|
91
|
+
this.writeNode(cell.content, context, false);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
writer.write(' |');
|
|
95
|
+
}
|
|
96
|
+
writer.writeLine();
|
|
97
|
+
// write the divider
|
|
98
|
+
writer.write('| ');
|
|
99
|
+
for (let i = 0; i < columnCount; ++i) {
|
|
100
|
+
writer.write(' --- |');
|
|
101
|
+
}
|
|
102
|
+
writer.writeLine();
|
|
103
|
+
for (const row of docTable.rows) {
|
|
104
|
+
writer.write('| ');
|
|
105
|
+
for (const cell of row.cells) {
|
|
106
|
+
writer.write(' ');
|
|
107
|
+
this.writeNode(cell.content, context, false);
|
|
108
|
+
writer.write(' |');
|
|
109
|
+
}
|
|
110
|
+
writer.writeLine();
|
|
111
|
+
}
|
|
112
|
+
writer.writeLine();
|
|
113
|
+
context.insideTable = false;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "EmphasisSpan" /* EmphasisSpan */: {
|
|
117
|
+
const docEmphasisSpan = docNode;
|
|
118
|
+
const oldBold = context.boldRequested;
|
|
119
|
+
const oldItalic = context.italicRequested;
|
|
120
|
+
context.boldRequested = docEmphasisSpan.bold;
|
|
121
|
+
context.italicRequested = docEmphasisSpan.italic;
|
|
122
|
+
this.writeNodes(docEmphasisSpan.nodes, context);
|
|
123
|
+
context.boldRequested = oldBold;
|
|
124
|
+
context.italicRequested = oldItalic;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
default:
|
|
128
|
+
super.writeNode(docNode, context, false);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/** @override */
|
|
132
|
+
writeLinkTagWithCodeDestination(docLinkTag, context) {
|
|
133
|
+
const options = context.options;
|
|
134
|
+
const result = this._apiModel.resolveDeclarationReference(docLinkTag.codeDestination, options.contextApiItem);
|
|
135
|
+
if (result.resolvedApiItem) {
|
|
136
|
+
const filename = options.onGetFilenameForApiItem(result.resolvedApiItem);
|
|
137
|
+
if (filename) {
|
|
138
|
+
let linkText = docLinkTag.linkText || '';
|
|
139
|
+
if (linkText.length === 0) {
|
|
140
|
+
// Generate a name such as Namespace1.Namespace2.MyClass.myMethod()
|
|
141
|
+
linkText = result.resolvedApiItem.getScopedNameWithinPackage();
|
|
142
|
+
}
|
|
143
|
+
if (linkText.length > 0) {
|
|
144
|
+
const encodedLinkText = this.getEscapedText(linkText.replace(/\s+/g, ' '));
|
|
145
|
+
context.writer.write('[');
|
|
146
|
+
context.writer.write(encodedLinkText);
|
|
147
|
+
context.writer.write(`](${filename})`);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
console.log(colors_1.default.yellow('WARNING: Unable to determine link text'));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else if (result.errorMessage) {
|
|
155
|
+
console.log(colors_1.default.yellow(`WARNING: Unable to resolve reference "${docLinkTag.codeDestination.emitAsTsdoc()}": ` +
|
|
156
|
+
result.errorMessage));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.CustomMarkdownEmitter = CustomMarkdownEmitter;
|
|
161
|
+
//# sourceMappingURL=CustomMarkdownEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomMarkdownEmitter.js","sourceRoot":"","sources":["../../src/markdown/CustomMarkdownEmitter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;AAEH,4FAA4F;AAC5F,2DAA2D;AAE3D,4DAA4B;AAe5B,uDAI2B;AAS3B,MAAa,qBAAsB,SAAQ,iCAAe;IAGxD,YAAmB,QAAkB;QACnC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,IAAI,CACT,aAA4B,EAC5B,OAAgB,EAChB,OAAsC;QAEtC,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,gBAAgB;IACN,SAAS,CACjB,OAAgB,EAChB,OAAgC,EAChC,eAAwB;QAExB,MAAM,MAAM,GAAmB,OAAO,CAAC,MAAM,CAAC;QAE9C,QAAQ,OAAO,CAAC,IAAI,EAAE;YACpB,4BAA8B,CAAC,CAAC;gBAC9B,MAAM,UAAU,GAAe,OAAqB,CAAC;gBACrD,MAAM,CAAC,iBAAiB,EAAE,CAAC;gBAE3B,IAAI,MAAc,CAAC;gBACnB,QAAQ,UAAU,CAAC,KAAK,EAAE;oBACxB,KAAK,CAAC;wBACJ,MAAM,GAAG,IAAI,CAAC;wBACd,MAAM;oBACR,KAAK,CAAC;wBACJ,MAAM,GAAG,KAAK,CAAC;wBACf,MAAM;oBACR,KAAK,CAAC;wBACJ,MAAM,GAAG,KAAK,CAAC;wBACf,MAAM;oBACR;wBACE,MAAM,GAAG,MAAM,CAAC;iBACnB;gBAED,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAA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,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,QAAS,GAAG,CAAC,CAAC;iBACzC;qBAAM;oBACL,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAC,CAAC;iBACtE;aACF;SACF;aAAM,IAAI,MAAM,CAAC,YAAY,EAAE;YAC9B,OAAO,CAAC,GAAG,CACT,gBAAM,CAAC,MAAM,CACX,yCAAyC,UAAU,CAAC,eAAgB,CAAC,WAAW,EAAE,KAAK;gBACrF,MAAM,CAAC,YAAY,CACtB,CACF,CAAC;SACH;IACH,CAAC;CACF;AAlLD,sDAkLC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { DocNode, StringBuilder, DocLinkTag } from '@microsoft/tsdoc';
|
|
18
|
+
import { IndentedWriter } from '../utils/IndentedWriter';
|
|
19
|
+
export interface IMarkdownEmitterOptions {
|
|
20
|
+
}
|
|
21
|
+
export interface IMarkdownEmitterContext<TOptions = IMarkdownEmitterOptions> {
|
|
22
|
+
writer: IndentedWriter;
|
|
23
|
+
insideTable: boolean;
|
|
24
|
+
boldRequested: boolean;
|
|
25
|
+
italicRequested: boolean;
|
|
26
|
+
writingBold: boolean;
|
|
27
|
+
writingItalic: boolean;
|
|
28
|
+
options: TOptions;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Renders MarkupElement content in the Markdown file format.
|
|
32
|
+
* For more info: https://en.wikipedia.org/wiki/Markdown
|
|
33
|
+
*/
|
|
34
|
+
export declare class MarkdownEmitter {
|
|
35
|
+
emit(stringBuilder: StringBuilder, docNode: DocNode, options: IMarkdownEmitterOptions): string;
|
|
36
|
+
protected getEscapedText(text: string): string;
|
|
37
|
+
protected getTableEscapedText(text: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* @virtual
|
|
40
|
+
*/
|
|
41
|
+
protected writeNode(docNode: DocNode, context: IMarkdownEmitterContext, docNodeSiblings: boolean): void;
|
|
42
|
+
/** @virtual */
|
|
43
|
+
protected writeLinkTagWithCodeDestination(docLinkTag: DocLinkTag, context: IMarkdownEmitterContext): void;
|
|
44
|
+
/** @virtual */
|
|
45
|
+
protected writeLinkTagWithUrlDestination(docLinkTag: DocLinkTag, context: IMarkdownEmitterContext): void;
|
|
46
|
+
protected writePlainText(text: string, context: IMarkdownEmitterContext): void;
|
|
47
|
+
protected writeNodes(docNodes: ReadonlyArray<DocNode>, context: IMarkdownEmitterContext): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2020 Google LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.MarkdownEmitter = void 0;
|
|
20
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
21
|
+
// See LICENSE in the project root for license information.
|
|
22
|
+
const tsdoc_1 = require("@microsoft/tsdoc");
|
|
23
|
+
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
24
|
+
const IndentedWriter_1 = require("../utils/IndentedWriter");
|
|
25
|
+
/**
|
|
26
|
+
* Renders MarkupElement content in the Markdown file format.
|
|
27
|
+
* For more info: https://en.wikipedia.org/wiki/Markdown
|
|
28
|
+
*/
|
|
29
|
+
class MarkdownEmitter {
|
|
30
|
+
emit(stringBuilder, docNode, options) {
|
|
31
|
+
const writer = new IndentedWriter_1.IndentedWriter(stringBuilder);
|
|
32
|
+
const context = {
|
|
33
|
+
writer,
|
|
34
|
+
insideTable: false,
|
|
35
|
+
boldRequested: false,
|
|
36
|
+
italicRequested: false,
|
|
37
|
+
writingBold: false,
|
|
38
|
+
writingItalic: false,
|
|
39
|
+
options
|
|
40
|
+
};
|
|
41
|
+
this.writeNode(docNode, context, false);
|
|
42
|
+
writer.ensureNewLine(); // finish the last line
|
|
43
|
+
return writer.toString();
|
|
44
|
+
}
|
|
45
|
+
getEscapedText(text) {
|
|
46
|
+
const textWithBackslashes = text
|
|
47
|
+
.replace(/\\/g, '\\\\') // first replace the escape character
|
|
48
|
+
.replace(/[*#[\]_|`~]/g, x => '\\' + x) // then escape any special characters
|
|
49
|
+
.replace(/---/g, '\\-\\-\\-') // hyphens only if it's 3 or more
|
|
50
|
+
.replace(/&/g, '&')
|
|
51
|
+
.replace(/</g, '<')
|
|
52
|
+
.replace(/>/g, '>');
|
|
53
|
+
return textWithBackslashes;
|
|
54
|
+
}
|
|
55
|
+
getTableEscapedText(text) {
|
|
56
|
+
return text
|
|
57
|
+
.replace(/&/g, '&')
|
|
58
|
+
.replace(/"/g, '"')
|
|
59
|
+
.replace(/</g, '<')
|
|
60
|
+
.replace(/>/g, '>')
|
|
61
|
+
.replace(/\|/g, '|');
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @virtual
|
|
65
|
+
*/
|
|
66
|
+
writeNode(docNode, context, docNodeSiblings) {
|
|
67
|
+
const writer = context.writer;
|
|
68
|
+
switch (docNode.kind) {
|
|
69
|
+
case "PlainText" /* PlainText */: {
|
|
70
|
+
const docPlainText = docNode;
|
|
71
|
+
this.writePlainText(docPlainText.text, context);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
case "HtmlStartTag" /* HtmlStartTag */:
|
|
75
|
+
case "HtmlEndTag" /* HtmlEndTag */: {
|
|
76
|
+
const docHtmlTag = docNode;
|
|
77
|
+
// write the HTML element verbatim into the output
|
|
78
|
+
writer.write(docHtmlTag.emitAsHtml());
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case "CodeSpan" /* CodeSpan */: {
|
|
82
|
+
const docCodeSpan = docNode;
|
|
83
|
+
if (context.insideTable) {
|
|
84
|
+
writer.write('<code>');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
writer.write('`');
|
|
88
|
+
}
|
|
89
|
+
if (context.insideTable) {
|
|
90
|
+
const code = this.getTableEscapedText(docCodeSpan.code);
|
|
91
|
+
const parts = code.split(/\r?\n/g);
|
|
92
|
+
writer.write(parts.join('</code><br/><code>'));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
writer.write(docCodeSpan.code);
|
|
96
|
+
}
|
|
97
|
+
if (context.insideTable) {
|
|
98
|
+
writer.write('</code>');
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
writer.write('`');
|
|
102
|
+
}
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
case "LinkTag" /* LinkTag */: {
|
|
106
|
+
const docLinkTag = docNode;
|
|
107
|
+
if (docLinkTag.codeDestination) {
|
|
108
|
+
this.writeLinkTagWithCodeDestination(docLinkTag, context);
|
|
109
|
+
}
|
|
110
|
+
else if (docLinkTag.urlDestination) {
|
|
111
|
+
this.writeLinkTagWithUrlDestination(docLinkTag, context);
|
|
112
|
+
}
|
|
113
|
+
else if (docLinkTag.linkText) {
|
|
114
|
+
this.writePlainText(docLinkTag.linkText, context);
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case "Paragraph" /* Paragraph */: {
|
|
119
|
+
const docParagraph = docNode;
|
|
120
|
+
const trimmedParagraph = tsdoc_1.DocNodeTransforms.trimSpacesInParagraph(docParagraph);
|
|
121
|
+
if (context.insideTable) {
|
|
122
|
+
if (docNodeSiblings) {
|
|
123
|
+
writer.write('<p>');
|
|
124
|
+
this.writeNodes(trimmedParagraph.nodes, context);
|
|
125
|
+
writer.write('</p>');
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
// Special case: If we are the only element inside this table cell, then we can omit the <p></p> container.
|
|
129
|
+
this.writeNodes(trimmedParagraph.nodes, context);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.writeNodes(trimmedParagraph.nodes, context);
|
|
134
|
+
writer.ensureNewLine();
|
|
135
|
+
writer.writeLine();
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
case "FencedCode" /* FencedCode */: {
|
|
140
|
+
const docFencedCode = docNode;
|
|
141
|
+
writer.ensureNewLine();
|
|
142
|
+
writer.write('```');
|
|
143
|
+
writer.write(docFencedCode.language);
|
|
144
|
+
writer.writeLine();
|
|
145
|
+
writer.write(docFencedCode.code);
|
|
146
|
+
writer.writeLine();
|
|
147
|
+
writer.writeLine('```');
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
case "Section" /* Section */: {
|
|
151
|
+
const docSection = docNode;
|
|
152
|
+
this.writeNodes(docSection.nodes, context);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
case "SoftBreak" /* SoftBreak */: {
|
|
156
|
+
if (!/^\s?$/.test(writer.peekLastCharacter())) {
|
|
157
|
+
writer.write(' ');
|
|
158
|
+
}
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
case "EscapedText" /* EscapedText */: {
|
|
162
|
+
const docEscapedText = docNode;
|
|
163
|
+
this.writePlainText(docEscapedText.decodedText, context);
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
case "ErrorText" /* ErrorText */: {
|
|
167
|
+
const docErrorText = docNode;
|
|
168
|
+
this.writePlainText(docErrorText.text, context);
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
case "InlineTag" /* InlineTag */: {
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case "BlockTag" /* BlockTag */: {
|
|
175
|
+
const tagNode = docNode;
|
|
176
|
+
console.warn('Unsupported block tag: ' + tagNode.tagName);
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
default:
|
|
180
|
+
throw new node_core_library_1.InternalError('Unsupported DocNodeKind kind: ' + docNode.kind);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** @virtual */
|
|
184
|
+
writeLinkTagWithCodeDestination(docLinkTag, context) {
|
|
185
|
+
// The subclass needs to implement this to support code destinations
|
|
186
|
+
throw new node_core_library_1.InternalError('writeLinkTagWithCodeDestination()');
|
|
187
|
+
}
|
|
188
|
+
/** @virtual */
|
|
189
|
+
writeLinkTagWithUrlDestination(docLinkTag, context) {
|
|
190
|
+
const linkText = docLinkTag.linkText !== undefined
|
|
191
|
+
? docLinkTag.linkText
|
|
192
|
+
: docLinkTag.urlDestination;
|
|
193
|
+
const encodedLinkText = this.getEscapedText(linkText.replace(/\s+/g, ' '));
|
|
194
|
+
context.writer.write('[');
|
|
195
|
+
context.writer.write(encodedLinkText);
|
|
196
|
+
context.writer.write(`](${docLinkTag.urlDestination})`);
|
|
197
|
+
}
|
|
198
|
+
writePlainText(text, context) {
|
|
199
|
+
const writer = context.writer;
|
|
200
|
+
// split out the [ leading whitespace, content, trailing whitespace ]
|
|
201
|
+
const parts = text.match(/^(\s*)(.*?)(\s*)$/) || [];
|
|
202
|
+
writer.write(parts[1]); // write leading whitespace
|
|
203
|
+
const middle = parts[2];
|
|
204
|
+
if (middle !== '') {
|
|
205
|
+
switch (writer.peekLastCharacter()) {
|
|
206
|
+
case '':
|
|
207
|
+
case '\n':
|
|
208
|
+
case ' ':
|
|
209
|
+
case '[':
|
|
210
|
+
case '>':
|
|
211
|
+
// okay to put a symbol
|
|
212
|
+
break;
|
|
213
|
+
default:
|
|
214
|
+
// This is no problem: "**one** *two* **three**"
|
|
215
|
+
// But this is trouble: "**one***two***three**"
|
|
216
|
+
// The most general solution: "**one**<!-- -->*two*<!-- -->**three**"
|
|
217
|
+
writer.write('<!-- -->');
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
if (context.boldRequested) {
|
|
221
|
+
writer.write('<b>');
|
|
222
|
+
}
|
|
223
|
+
if (context.italicRequested) {
|
|
224
|
+
writer.write('<i>');
|
|
225
|
+
}
|
|
226
|
+
writer.write(this.getEscapedText(middle));
|
|
227
|
+
if (context.italicRequested) {
|
|
228
|
+
writer.write('</i>');
|
|
229
|
+
}
|
|
230
|
+
if (context.boldRequested) {
|
|
231
|
+
writer.write('</b>');
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
writer.write(parts[3]); // write trailing whitespace
|
|
235
|
+
}
|
|
236
|
+
writeNodes(docNodes, context) {
|
|
237
|
+
for (const docNode of docNodes) {
|
|
238
|
+
this.writeNode(docNode, context, docNodes.length > 1);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
exports.MarkdownEmitter = MarkdownEmitter;
|
|
243
|
+
//# sourceMappingURL=MarkdownEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownEmitter.js","sourceRoot":"","sources":["../../src/markdown/MarkdownEmitter.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AI,CAAC;gBACV,KAAK,GAAG,CAAC;gBACT,KAAK,GAAG,CAAC;gBACT,KAAK,GAAG;oBACN,uBAAuB;oBACvB,MAAM;gBACR;oBACE,uDAAuD;oBACvD,qDAAqD;oBACrD,qEAAqE;oBACrE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;oBACzB,MAAM;aACT;YAED,IAAI,OAAO,CAAC,aAAa,EAAE;gBACzB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aACrB;YACD,IAAI,OAAO,CAAC,eAAe,EAAE;gBAC3B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aACrB;YAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;YAE1C,IAAI,OAAO,CAAC,eAAe,EAAE;gBAC3B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aACtB;YACD,IAAI,OAAO,CAAC,aAAa,EAAE;gBACzB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aACtB;SACF;QAED,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,4BAA4B;IACtD,CAAC;IAES,UAAU,CAClB,QAAgC,EAChC,OAAgC;QAEhC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACvD;IACH,CAAC;CACF;AAnQD,0CAmQC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|