typedoc 0.24.6 → 0.24.8
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/dist/lib/application.d.ts +9 -0
- package/dist/lib/application.js +20 -8
- package/dist/lib/converter/comments/blockLexer.js +1 -1
- package/dist/lib/converter/comments/lexer.js +1 -1
- package/dist/lib/converter/comments/lineLexer.js +1 -1
- package/dist/lib/converter/comments/rawLexer.js +1 -1
- package/dist/lib/converter/converter.js +2 -3
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +1 -0
- package/dist/lib/converter/plugins/CategoryPlugin.js +17 -22
- package/dist/lib/converter/plugins/CommentPlugin.js +8 -5
- package/dist/lib/converter/plugins/GroupPlugin.js +2 -3
- package/dist/lib/converter/plugins/ImplementsPlugin.js +2 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.js +2 -3
- package/dist/lib/converter/plugins/LinkResolverPlugin.js +2 -3
- package/dist/lib/converter/plugins/PackagePlugin.js +4 -4
- package/dist/lib/converter/plugins/SourcePlugin.js +2 -3
- package/dist/lib/converter/plugins/TypePlugin.js +2 -3
- package/dist/lib/models/reflections/abstract.js +3 -3
- package/dist/lib/models/reflections/declaration.js +1 -1
- package/dist/lib/models/reflections/kind.js +2 -2
- package/dist/lib/output/events.d.ts +6 -0
- package/dist/lib/output/events.js +10 -4
- package/dist/lib/output/plugins/AssetsPlugin.js +2 -3
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +2 -3
- package/dist/lib/output/renderer.d.ts +2 -0
- package/dist/lib/output/renderer.js +7 -3
- package/dist/lib/output/theme.js +2 -3
- package/dist/lib/output/themes/MarkedPlugin.js +5 -4
- package/dist/lib/output/themes/default/DefaultTheme.js +1 -1
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +3 -0
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +3 -0
- package/dist/lib/output/themes/default/partials/comment.d.ts +2 -0
- package/dist/lib/output/themes/default/partials/comment.js +20 -2
- package/dist/lib/output/themes/default/partials/icon.js +8 -9
- package/dist/lib/output/themes/default/partials/index.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/index.js +0 -6
- package/dist/lib/output/themes/default/partials/member.declaration.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.declaration.js +34 -21
- package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -2
- package/dist/lib/output/themes/default/partials/navigation.js +2 -2
- package/dist/lib/output/themes/default/partials/parameter.js +8 -4
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -1
- package/dist/lib/output/themes/default/templates/reflection.js +9 -2
- package/dist/lib/serialization/serializer.js +1 -1
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +1 -1
- package/dist/lib/utils/entry-point.d.ts +1 -1
- package/dist/lib/utils/entry-point.js +7 -2
- package/dist/lib/utils/jsx.d.ts +3 -0
- package/dist/lib/utils/jsx.js +7 -2
- package/dist/lib/utils/loggers.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +1 -0
- package/dist/lib/utils/options/declaration.js +2 -2
- package/dist/lib/utils/options/options.d.ts +5 -1
- package/dist/lib/utils/options/options.js +2 -1
- package/dist/lib/utils/options/sources/typedoc.js +1 -0
- package/package.json +3 -3
- package/static/main.js +1 -1
- package/static/style.css +6 -4
|
@@ -77,6 +77,15 @@ export declare class Application extends ChildableComponent<Application, Abstrac
|
|
|
77
77
|
bootstrapWithPlugins(options?: Partial<TypeDocOptions>): Promise<void>;
|
|
78
78
|
/**
|
|
79
79
|
* Initialize TypeDoc without loading plugins.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* Initialize the application with pretty-printing output disabled.
|
|
83
|
+
* ```ts
|
|
84
|
+
* const app = new Application();
|
|
85
|
+
* app.bootstrap({ pretty: false });
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param options - Options to set during initialization
|
|
80
89
|
*/
|
|
81
90
|
bootstrap(options?: Partial<TypeDocOptions>): void;
|
|
82
91
|
private setOptions;
|
package/dist/lib/application.js
CHANGED
|
@@ -72,7 +72,7 @@ const supportedVersionMajorMinor = packageInfo.peerDependencies.typescript
|
|
|
72
72
|
* Both the {@link Converter} and the {@link Renderer} emit a series of events while processing the project.
|
|
73
73
|
* Subscribe to these Events to control the application flow or alter the output.
|
|
74
74
|
*/
|
|
75
|
-
let Application = Application_1 = class Application extends component_1.ChildableComponent {
|
|
75
|
+
let Application = exports.Application = Application_1 = class Application extends component_1.ChildableComponent {
|
|
76
76
|
/**
|
|
77
77
|
* Create a new TypeDoc application instance.
|
|
78
78
|
*/
|
|
@@ -104,6 +104,15 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* Initialize TypeDoc without loading plugins.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* Initialize the application with pretty-printing output disabled.
|
|
110
|
+
* ```ts
|
|
111
|
+
* const app = new Application();
|
|
112
|
+
* app.bootstrap({ pretty: false });
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @param options - Options to set during initialization
|
|
107
116
|
*/
|
|
108
117
|
bootstrap(options = {}) {
|
|
109
118
|
this.options.reset();
|
|
@@ -333,6 +342,10 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
333
342
|
].join("\n");
|
|
334
343
|
}
|
|
335
344
|
_convertPackages() {
|
|
345
|
+
if (!this.options.isSet("entryPoints")) {
|
|
346
|
+
this.logger.error("No entry points provided to packages mode, documentation cannot be generated.");
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
336
349
|
const packageDirs = (0, entry_point_1.getPackageDirectories)(this.logger, this.options, this.options.getValue("entryPoints"));
|
|
337
350
|
if (packageDirs.length === 0) {
|
|
338
351
|
this.logger.error("Failed to find any packages, ensure you have provided at least one directory as an entry point containing package.json");
|
|
@@ -343,7 +356,7 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
343
356
|
// Generate a json file for each package
|
|
344
357
|
for (const dir of packageDirs) {
|
|
345
358
|
this.logger.info(`Converting project at ${(0, paths_1.nicePath)(dir)}`);
|
|
346
|
-
const opts = origOptions.copyForPackage();
|
|
359
|
+
const opts = origOptions.copyForPackage(dir);
|
|
347
360
|
// Invalid links should only be reported after everything has been merged.
|
|
348
361
|
opts.setValue("validation", { invalidLink: false });
|
|
349
362
|
opts.read(this.logger, dir);
|
|
@@ -372,6 +385,10 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
372
385
|
}
|
|
373
386
|
_merge() {
|
|
374
387
|
const start = Date.now();
|
|
388
|
+
if (!this.options.isSet("entryPoints")) {
|
|
389
|
+
this.logger.error("No entry points provided to merge.");
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
375
392
|
const rootDir = (0, fs_1.deriveRootDir)(this.entryPoints);
|
|
376
393
|
const entryPoints = this.entryPoints.flatMap((entry) => {
|
|
377
394
|
const result = (0, fs_1.glob)(entry, rootDir);
|
|
@@ -385,10 +402,6 @@ let Application = Application_1 = class Application extends component_1.Childabl
|
|
|
385
402
|
}
|
|
386
403
|
return result;
|
|
387
404
|
});
|
|
388
|
-
if (entryPoints.length < 1) {
|
|
389
|
-
this.logger.error("No entry points provided to merge.");
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
405
|
const jsonProjects = entryPoints.map((path) => {
|
|
393
406
|
try {
|
|
394
407
|
return JSON.parse((0, fs_1.readFile)(path));
|
|
@@ -434,7 +447,6 @@ __decorate([
|
|
|
434
447
|
__decorate([
|
|
435
448
|
(0, utils_1.BindOption)("entryPoints")
|
|
436
449
|
], Application.prototype, "entryPoints", void 0);
|
|
437
|
-
Application = Application_1 = __decorate([
|
|
450
|
+
exports.Application = Application = Application_1 = __decorate([
|
|
438
451
|
(0, component_1.Component)({ name: "application", internal: true })
|
|
439
452
|
], Application);
|
|
440
|
-
exports.Application = Application;
|
|
@@ -202,7 +202,7 @@ function* lexBlockComment2(file, pos, end, linkTags, checker) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
if (lookahead !== pos + 1 &&
|
|
205
|
-
(lookahead === end ||
|
|
205
|
+
(lookahead === end || /[\s}]/.test(file[lookahead]))) {
|
|
206
206
|
braceStartsType = true;
|
|
207
207
|
const token = makeToken(lexer_1.TokenSyntaxKind.Tag, lookahead - pos);
|
|
208
208
|
attachLinkTagResult(token);
|
|
@@ -10,4 +10,4 @@ var TokenSyntaxKind;
|
|
|
10
10
|
TokenSyntaxKind["Tag"] = "tag";
|
|
11
11
|
TokenSyntaxKind["Code"] = "code";
|
|
12
12
|
TokenSyntaxKind["TypeAnnotation"] = "type";
|
|
13
|
-
})(TokenSyntaxKind
|
|
13
|
+
})(TokenSyntaxKind || (exports.TokenSyntaxKind = TokenSyntaxKind = {}));
|
|
@@ -138,7 +138,7 @@ function* lexLineComments2(file, pos, end) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
if (lookahead !== pos + 1 &&
|
|
141
|
-
(lookahead === end ||
|
|
141
|
+
(lookahead === end || /[\s}]/.test(file[lookahead]))) {
|
|
142
142
|
braceStartsType = true;
|
|
143
143
|
yield makeToken(lexer_1.TokenSyntaxKind.Tag, lookahead - pos);
|
|
144
144
|
break;
|
|
@@ -142,7 +142,7 @@ function* lexCommentString2(file) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
if (lookahead !== pos + 1 &&
|
|
145
|
-
(lookahead === end ||
|
|
145
|
+
(lookahead === end || /[\s}]/.test(file[lookahead]))) {
|
|
146
146
|
braceStartsType = true;
|
|
147
147
|
yield makeToken(lexer_1.TokenSyntaxKind.Tag, lookahead - pos);
|
|
148
148
|
break;
|
|
@@ -28,7 +28,7 @@ const linkResolver_1 = require("./comments/linkResolver");
|
|
|
28
28
|
/**
|
|
29
29
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
30
30
|
*/
|
|
31
|
-
let Converter = Converter_1 = class Converter extends component_1.ChildableComponent {
|
|
31
|
+
let Converter = exports.Converter = Converter_1 = class Converter extends component_1.ChildableComponent {
|
|
32
32
|
get config() {
|
|
33
33
|
return this._config || this._buildCommentParserConfig();
|
|
34
34
|
}
|
|
@@ -343,14 +343,13 @@ __decorate([
|
|
|
343
343
|
__decorate([
|
|
344
344
|
(0, utils_1.BindOption)("useTsLinkResolution")
|
|
345
345
|
], Converter.prototype, "useTsLinkResolution", void 0);
|
|
346
|
-
Converter = Converter_1 = __decorate([
|
|
346
|
+
exports.Converter = Converter = Converter_1 = __decorate([
|
|
347
347
|
(0, component_1.Component)({
|
|
348
348
|
name: "converter",
|
|
349
349
|
internal: true,
|
|
350
350
|
childClass: components_1.ConverterComponent,
|
|
351
351
|
})
|
|
352
352
|
], Converter);
|
|
353
|
-
exports.Converter = Converter;
|
|
354
353
|
function getSymbolForModuleLike(context, node) {
|
|
355
354
|
const symbol = context.checker.getSymbolAtLocation(node) ?? node.symbol;
|
|
356
355
|
if (symbol) {
|
|
@@ -7,6 +7,7 @@ import { ConverterComponent } from "../components";
|
|
|
7
7
|
* The handler sets the ´category´ property of all reflections.
|
|
8
8
|
*/
|
|
9
9
|
export declare class CategoryPlugin extends ConverterComponent {
|
|
10
|
+
sortFunction: (reflections: DeclarationReflection[]) => void;
|
|
10
11
|
defaultCategory: string;
|
|
11
12
|
categoryOrder: string[];
|
|
12
13
|
categorizeByGroup: boolean;
|
|
@@ -18,7 +18,7 @@ const utils_1 = require("../../utils");
|
|
|
18
18
|
*
|
|
19
19
|
* The handler sets the ´category´ property of all reflections.
|
|
20
20
|
*/
|
|
21
|
-
let CategoryPlugin = CategoryPlugin_1 = class CategoryPlugin extends components_1.ConverterComponent {
|
|
21
|
+
let CategoryPlugin = exports.CategoryPlugin = CategoryPlugin_1 = class CategoryPlugin extends components_1.ConverterComponent {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
24
|
this.usedBoosts = new Set();
|
|
@@ -37,6 +37,7 @@ let CategoryPlugin = CategoryPlugin_1 = class CategoryPlugin extends components_
|
|
|
37
37
|
* Triggered when the converter begins converting a project.
|
|
38
38
|
*/
|
|
39
39
|
onBegin(_context) {
|
|
40
|
+
this.sortFunction = (0, utils_1.getSortFunction)(this.application.options);
|
|
40
41
|
// Set up static properties
|
|
41
42
|
if (this.defaultCategory) {
|
|
42
43
|
CategoryPlugin_1.defaultCategory = this.defaultCategory;
|
|
@@ -123,33 +124,28 @@ let CategoryPlugin = CategoryPlugin_1 = class CategoryPlugin extends components_
|
|
|
123
124
|
* @returns An array containing all children of the given reflection categorized
|
|
124
125
|
*/
|
|
125
126
|
getReflectionCategories(reflections) {
|
|
126
|
-
const categories =
|
|
127
|
-
|
|
128
|
-
reflections.forEach((child) => {
|
|
127
|
+
const categories = new Map();
|
|
128
|
+
for (const child of reflections) {
|
|
129
129
|
const childCategories = this.getCategories(child);
|
|
130
130
|
if (childCategories.size === 0) {
|
|
131
|
-
|
|
132
|
-
defaultCat = categories.find((category) => category.title === CategoryPlugin_1.defaultCategory);
|
|
133
|
-
if (!defaultCat) {
|
|
134
|
-
defaultCat = new models_2.ReflectionCategory(CategoryPlugin_1.defaultCategory);
|
|
135
|
-
categories.push(defaultCat);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
defaultCat.children.push(child);
|
|
139
|
-
return;
|
|
131
|
+
childCategories.add(CategoryPlugin_1.defaultCategory);
|
|
140
132
|
}
|
|
141
133
|
for (const childCat of childCategories) {
|
|
142
|
-
|
|
134
|
+
const category = categories.get(childCat);
|
|
143
135
|
if (category) {
|
|
144
136
|
category.children.push(child);
|
|
145
|
-
continue;
|
|
146
137
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
138
|
+
else {
|
|
139
|
+
const cat = new models_2.ReflectionCategory(childCat);
|
|
140
|
+
cat.children.push(child);
|
|
141
|
+
categories.set(childCat, cat);
|
|
142
|
+
}
|
|
150
143
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
144
|
+
}
|
|
145
|
+
for (const cat of categories.values()) {
|
|
146
|
+
this.sortFunction(cat.children);
|
|
147
|
+
}
|
|
148
|
+
return Array.from(categories.values());
|
|
153
149
|
}
|
|
154
150
|
/**
|
|
155
151
|
* Return the category of a given reflection.
|
|
@@ -236,7 +232,6 @@ __decorate([
|
|
|
236
232
|
__decorate([
|
|
237
233
|
(0, utils_1.BindOption)("searchCategoryBoosts")
|
|
238
234
|
], CategoryPlugin.prototype, "boosts", void 0);
|
|
239
|
-
CategoryPlugin = CategoryPlugin_1 = __decorate([
|
|
235
|
+
exports.CategoryPlugin = CategoryPlugin = CategoryPlugin_1 = __decorate([
|
|
240
236
|
(0, components_1.Component)({ name: "category" })
|
|
241
237
|
], CategoryPlugin);
|
|
242
|
-
exports.CategoryPlugin = CategoryPlugin;
|
|
@@ -88,7 +88,7 @@ const NEVER_RENDERED = [
|
|
|
88
88
|
* - Resolve `@link` tags to point to target reflections
|
|
89
89
|
*
|
|
90
90
|
*/
|
|
91
|
-
let CommentPlugin = class CommentPlugin extends components_1.ConverterComponent {
|
|
91
|
+
let CommentPlugin = exports.CommentPlugin = class CommentPlugin extends components_1.ConverterComponent {
|
|
92
92
|
get excludeNotDocumentedKinds() {
|
|
93
93
|
this._excludeKinds ?? (this._excludeKinds = this.application.options
|
|
94
94
|
.getValue("excludeNotDocumentedKinds")
|
|
@@ -289,11 +289,15 @@ let CommentPlugin = class CommentPlugin extends components_1.ConverterComponent
|
|
|
289
289
|
if (!signatures.length) {
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
const comment = reflection.
|
|
292
|
+
const comment = reflection.kindOf(models_1.ReflectionKind.ClassOrInterface)
|
|
293
|
+
? undefined
|
|
294
|
+
: reflection.comment;
|
|
293
295
|
// Since this reflection has signatures, remove the comment from the parent
|
|
294
296
|
// reflection. This is important so that in type aliases we don't end up with
|
|
295
297
|
// a comment rendered twice.
|
|
296
|
-
|
|
298
|
+
if (!reflection.kindOf(models_1.ReflectionKind.ClassOrInterface)) {
|
|
299
|
+
delete reflection.comment;
|
|
300
|
+
}
|
|
297
301
|
for (const signature of signatures) {
|
|
298
302
|
const childComment = (signature.comment || (signature.comment = comment?.clone()));
|
|
299
303
|
if (!childComment)
|
|
@@ -414,10 +418,9 @@ __decorate([
|
|
|
414
418
|
__decorate([
|
|
415
419
|
(0, utils_1.BindOption)("excludeNotDocumented")
|
|
416
420
|
], CommentPlugin.prototype, "excludeNotDocumented", void 0);
|
|
417
|
-
CommentPlugin = __decorate([
|
|
421
|
+
exports.CommentPlugin = CommentPlugin = __decorate([
|
|
418
422
|
(0, components_1.Component)({ name: "comment" })
|
|
419
423
|
], CommentPlugin);
|
|
420
|
-
exports.CommentPlugin = CommentPlugin;
|
|
421
424
|
function inTypeLiteral(refl) {
|
|
422
425
|
while (refl) {
|
|
423
426
|
if (refl.kind === models_1.ReflectionKind.TypeLiteral) {
|
|
@@ -20,7 +20,7 @@ const models_1 = require("../../models");
|
|
|
20
20
|
*
|
|
21
21
|
* The handler sets the `groups` property of all container reflections.
|
|
22
22
|
*/
|
|
23
|
-
let GroupPlugin = GroupPlugin_1 = class GroupPlugin extends components_1.ConverterComponent {
|
|
23
|
+
let GroupPlugin = exports.GroupPlugin = GroupPlugin_1 = class GroupPlugin extends components_1.ConverterComponent {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(...arguments);
|
|
26
26
|
this.usedBoosts = new Set();
|
|
@@ -170,7 +170,6 @@ __decorate([
|
|
|
170
170
|
__decorate([
|
|
171
171
|
(0, utils_1.BindOption)("groupOrder")
|
|
172
172
|
], GroupPlugin.prototype, "groupOrder", void 0);
|
|
173
|
-
GroupPlugin = GroupPlugin_1 = __decorate([
|
|
173
|
+
exports.GroupPlugin = GroupPlugin = GroupPlugin_1 = __decorate([
|
|
174
174
|
(0, components_1.Component)({ name: "group" })
|
|
175
175
|
], GroupPlugin);
|
|
176
|
-
exports.GroupPlugin = GroupPlugin;
|
|
@@ -22,7 +22,7 @@ const utils_1 = require("../../utils");
|
|
|
22
22
|
* A plugin that detects interface implementations of functions and
|
|
23
23
|
* properties on classes and links them.
|
|
24
24
|
*/
|
|
25
|
-
let ImplementsPlugin = class ImplementsPlugin extends components_1.ConverterComponent {
|
|
25
|
+
let ImplementsPlugin = exports.ImplementsPlugin = class ImplementsPlugin extends components_1.ConverterComponent {
|
|
26
26
|
constructor() {
|
|
27
27
|
super(...arguments);
|
|
28
28
|
this.resolved = new WeakSet();
|
|
@@ -224,10 +224,9 @@ let ImplementsPlugin = class ImplementsPlugin extends components_1.ConverterComp
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
ImplementsPlugin = __decorate([
|
|
227
|
+
exports.ImplementsPlugin = ImplementsPlugin = __decorate([
|
|
228
228
|
(0, components_1.Component)({ name: "implements" })
|
|
229
229
|
], ImplementsPlugin);
|
|
230
|
-
exports.ImplementsPlugin = ImplementsPlugin;
|
|
231
230
|
function constructorInheritance(context, reflection, childDecl, constructorDecl) {
|
|
232
231
|
const extendsClause = childDecl.heritageClauses?.find((cl) => cl.token === typescript_1.default.SyntaxKind.ExtendsKeyword);
|
|
233
232
|
if (!extendsClause)
|
|
@@ -28,7 +28,7 @@ const application_events_1 = require("../../application-events");
|
|
|
28
28
|
* - `@typeParam` block
|
|
29
29
|
* - `@return` block
|
|
30
30
|
*/
|
|
31
|
-
let InheritDocPlugin = class InheritDocPlugin extends components_1.ConverterComponent {
|
|
31
|
+
let InheritDocPlugin = exports.InheritDocPlugin = class InheritDocPlugin extends components_1.ConverterComponent {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
34
34
|
// Key is depended on by Values
|
|
@@ -159,10 +159,9 @@ let InheritDocPlugin = class InheritDocPlugin extends components_1.ConverterComp
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
InheritDocPlugin = __decorate([
|
|
162
|
+
exports.InheritDocPlugin = InheritDocPlugin = __decorate([
|
|
163
163
|
(0, components_1.Component)({ name: "inheritDoc" })
|
|
164
164
|
], InheritDocPlugin);
|
|
165
|
-
exports.InheritDocPlugin = InheritDocPlugin;
|
|
166
165
|
function copySummaries(source, target) {
|
|
167
166
|
for (const [s, t] of (0, array_1.zip)(source || [], target || [])) {
|
|
168
167
|
t.comment = new models_1.Comment(s.comment?.summary);
|
|
@@ -16,7 +16,7 @@ const application_events_1 = require("../../application-events");
|
|
|
16
16
|
/**
|
|
17
17
|
* A plugin that resolves `{@link Foo}` tags.
|
|
18
18
|
*/
|
|
19
|
-
let LinkResolverPlugin = class LinkResolverPlugin extends components_1.ConverterComponent {
|
|
19
|
+
let LinkResolverPlugin = exports.LinkResolverPlugin = class LinkResolverPlugin extends components_1.ConverterComponent {
|
|
20
20
|
initialize() {
|
|
21
21
|
super.initialize();
|
|
22
22
|
this.owner.on(converter_events_1.ConverterEvents.RESOLVE_END, this.onResolve, this, -300);
|
|
@@ -56,7 +56,6 @@ let LinkResolverPlugin = class LinkResolverPlugin extends components_1.Converter
|
|
|
56
56
|
__decorate([
|
|
57
57
|
(0, utils_1.BindOption)("validation")
|
|
58
58
|
], LinkResolverPlugin.prototype, "validation", void 0);
|
|
59
|
-
LinkResolverPlugin = __decorate([
|
|
59
|
+
exports.LinkResolverPlugin = LinkResolverPlugin = __decorate([
|
|
60
60
|
(0, components_1.Component)({ name: "link-resolver" })
|
|
61
61
|
], LinkResolverPlugin);
|
|
62
|
-
exports.LinkResolverPlugin = LinkResolverPlugin;
|
|
@@ -43,7 +43,7 @@ const path_1 = require("path");
|
|
|
43
43
|
* A handler that tries to find the package.json and readme.md files of the
|
|
44
44
|
* current project.
|
|
45
45
|
*/
|
|
46
|
-
let PackagePlugin = class PackagePlugin extends components_1.ConverterComponent {
|
|
46
|
+
let PackagePlugin = exports.PackagePlugin = class PackagePlugin extends components_1.ConverterComponent {
|
|
47
47
|
initialize() {
|
|
48
48
|
this.listenTo(this.owner, {
|
|
49
49
|
[converter_1.Converter.EVENT_BEGIN]: this.onBegin,
|
|
@@ -72,7 +72,8 @@ let PackagePlugin = class PackagePlugin extends components_1.ConverterComponent
|
|
|
72
72
|
const entryFiles = this.entryPointStrategy === utils_1.EntryPointStrategy.Packages
|
|
73
73
|
? this.entryPoints.map((d) => (0, path_1.join)(d, "package.json"))
|
|
74
74
|
: this.entryPoints;
|
|
75
|
-
const dirName =
|
|
75
|
+
const dirName = this.application.options.packageDir ??
|
|
76
|
+
Path.resolve((0, fs_1.deriveRootDir)(entryFiles));
|
|
76
77
|
this.application.logger.verbose(`Begin readme.md/package.json search at ${(0, paths_1.nicePath)(dirName)}`);
|
|
77
78
|
this.packageJson = (0, fs_1.discoverPackageJson)(dirName)?.content;
|
|
78
79
|
// Path will be resolved already. This is kind of ugly, but...
|
|
@@ -140,7 +141,6 @@ __decorate([
|
|
|
140
141
|
__decorate([
|
|
141
142
|
(0, utils_1.BindOption)("includeVersion")
|
|
142
143
|
], PackagePlugin.prototype, "includeVersion", void 0);
|
|
143
|
-
PackagePlugin = __decorate([
|
|
144
|
+
exports.PackagePlugin = PackagePlugin = __decorate([
|
|
144
145
|
(0, components_1.Component)({ name: "package" })
|
|
145
146
|
], PackagePlugin);
|
|
146
|
-
exports.PackagePlugin = PackagePlugin;
|
|
@@ -23,7 +23,7 @@ const base_path_1 = require("../utils/base-path");
|
|
|
23
23
|
/**
|
|
24
24
|
* A handler that attaches source file information to reflections.
|
|
25
25
|
*/
|
|
26
|
-
let SourcePlugin = class SourcePlugin extends components_1.ConverterComponent {
|
|
26
|
+
let SourcePlugin = exports.SourcePlugin = class SourcePlugin extends components_1.ConverterComponent {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
29
29
|
/**
|
|
@@ -163,7 +163,6 @@ __decorate([
|
|
|
163
163
|
__decorate([
|
|
164
164
|
(0, utils_1.BindOption)("basePath")
|
|
165
165
|
], SourcePlugin.prototype, "basePath", void 0);
|
|
166
|
-
SourcePlugin = __decorate([
|
|
166
|
+
exports.SourcePlugin = SourcePlugin = __decorate([
|
|
167
167
|
(0, components_1.Component)({ name: "source" })
|
|
168
168
|
], SourcePlugin);
|
|
169
|
-
exports.SourcePlugin = SourcePlugin;
|
|
@@ -15,7 +15,7 @@ const application_events_1 = require("../../application-events");
|
|
|
15
15
|
/**
|
|
16
16
|
* Responsible for adding `implementedBy` / `implementedFrom`
|
|
17
17
|
*/
|
|
18
|
-
let TypePlugin = class TypePlugin extends components_1.ConverterComponent {
|
|
18
|
+
let TypePlugin = exports.TypePlugin = class TypePlugin extends components_1.ConverterComponent {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this.reflections = new Set();
|
|
@@ -121,7 +121,6 @@ let TypePlugin = class TypePlugin extends components_1.ConverterComponent {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
TypePlugin = __decorate([
|
|
124
|
+
exports.TypePlugin = TypePlugin = __decorate([
|
|
125
125
|
(0, components_1.Component)({ name: "type" })
|
|
126
126
|
], TypePlugin);
|
|
127
|
-
exports.TypePlugin = TypePlugin;
|
|
@@ -34,7 +34,7 @@ var ReflectionFlag;
|
|
|
34
34
|
ReflectionFlag[ReflectionFlag["Const"] = 1024] = "Const";
|
|
35
35
|
ReflectionFlag[ReflectionFlag["Let"] = 2048] = "Let";
|
|
36
36
|
ReflectionFlag[ReflectionFlag["Readonly"] = 4096] = "Readonly";
|
|
37
|
-
})(ReflectionFlag
|
|
37
|
+
})(ReflectionFlag || (exports.ReflectionFlag = ReflectionFlag = {}));
|
|
38
38
|
const relevantFlags = [
|
|
39
39
|
ReflectionFlag.Private,
|
|
40
40
|
ReflectionFlag.Protected,
|
|
@@ -170,6 +170,7 @@ class ReflectionFlags extends Array {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
exports.ReflectionFlags = ReflectionFlags;
|
|
173
174
|
ReflectionFlags.serializedFlags = [
|
|
174
175
|
"isPrivate",
|
|
175
176
|
"isProtected",
|
|
@@ -183,7 +184,6 @@ ReflectionFlags.serializedFlags = [
|
|
|
183
184
|
"isConst",
|
|
184
185
|
"isReadonly",
|
|
185
186
|
];
|
|
186
|
-
exports.ReflectionFlags = ReflectionFlags;
|
|
187
187
|
var TraverseProperty;
|
|
188
188
|
(function (TraverseProperty) {
|
|
189
189
|
TraverseProperty[TraverseProperty["Children"] = 0] = "Children";
|
|
@@ -194,7 +194,7 @@ var TraverseProperty;
|
|
|
194
194
|
TraverseProperty[TraverseProperty["IndexSignature"] = 5] = "IndexSignature";
|
|
195
195
|
TraverseProperty[TraverseProperty["GetSignature"] = 6] = "GetSignature";
|
|
196
196
|
TraverseProperty[TraverseProperty["SetSignature"] = 7] = "SetSignature";
|
|
197
|
-
})(TraverseProperty
|
|
197
|
+
})(TraverseProperty || (exports.TraverseProperty = TraverseProperty = {}));
|
|
198
198
|
/**
|
|
199
199
|
* Base class for all reflection classes.
|
|
200
200
|
*
|
|
@@ -15,7 +15,7 @@ var ConversionFlags;
|
|
|
15
15
|
(function (ConversionFlags) {
|
|
16
16
|
ConversionFlags[ConversionFlags["None"] = 0] = "None";
|
|
17
17
|
ConversionFlags[ConversionFlags["VariableOrPropertySource"] = 1] = "VariableOrPropertySource";
|
|
18
|
-
})(ConversionFlags
|
|
18
|
+
})(ConversionFlags || (exports.ConversionFlags = ConversionFlags = {}));
|
|
19
19
|
/**
|
|
20
20
|
* A reflection that represents a single declaration emitted by the TypeScript compiler.
|
|
21
21
|
*
|
|
@@ -31,7 +31,7 @@ var ReflectionKind;
|
|
|
31
31
|
ReflectionKind[ReflectionKind["ObjectLiteral"] = 2097152] = "ObjectLiteral";
|
|
32
32
|
ReflectionKind[ReflectionKind["TypeAlias"] = 4194304] = "TypeAlias";
|
|
33
33
|
ReflectionKind[ReflectionKind["Reference"] = 8388608] = "Reference";
|
|
34
|
-
})(ReflectionKind
|
|
34
|
+
})(ReflectionKind || (exports.ReflectionKind = ReflectionKind = {}));
|
|
35
35
|
(function (ReflectionKind) {
|
|
36
36
|
ReflectionKind.All = ReflectionKind.Reference * 2 - 1;
|
|
37
37
|
/** @internal */
|
|
@@ -129,7 +129,7 @@ var ReflectionKind;
|
|
|
129
129
|
.toLowerCase()}`;
|
|
130
130
|
}
|
|
131
131
|
ReflectionKind.classString = classString;
|
|
132
|
-
})(ReflectionKind
|
|
132
|
+
})(ReflectionKind || (exports.ReflectionKind = ReflectionKind = {}));
|
|
133
133
|
function getKindString(kind) {
|
|
134
134
|
return ReflectionKind[kind].replace(/(.)([A-Z])/g, (_m, a, b) => a + " " + b.toLowerCase());
|
|
135
135
|
}
|
|
@@ -101,6 +101,7 @@ export declare class PageEvent<out Model = unknown> extends Event {
|
|
|
101
101
|
* An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
|
|
102
102
|
*
|
|
103
103
|
* @see {@link MarkdownEvent.PARSE}
|
|
104
|
+
* @see {@link MarkdownEvent.INCLUDE}
|
|
104
105
|
*/
|
|
105
106
|
export declare class MarkdownEvent extends Event {
|
|
106
107
|
/**
|
|
@@ -120,6 +121,11 @@ export declare class MarkdownEvent extends Event {
|
|
|
120
121
|
* @event
|
|
121
122
|
*/
|
|
122
123
|
static readonly PARSE = "parseMarkdown";
|
|
124
|
+
/**
|
|
125
|
+
* Triggered on the renderer when this plugin includes a markdown file through a markdown include tag.
|
|
126
|
+
* @event
|
|
127
|
+
*/
|
|
128
|
+
static readonly INCLUDE = "includeMarkdown";
|
|
123
129
|
constructor(name: string, page: PageEvent, originalText: string, parsedText: string);
|
|
124
130
|
}
|
|
125
131
|
/**
|
|
@@ -54,6 +54,7 @@ class RendererEvent extends events_1.Event {
|
|
|
54
54
|
return [mapping.template, event];
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
exports.RendererEvent = RendererEvent;
|
|
57
58
|
/**
|
|
58
59
|
* Triggered before the renderer starts rendering a project.
|
|
59
60
|
* @event
|
|
@@ -64,7 +65,6 @@ RendererEvent.BEGIN = "beginRender";
|
|
|
64
65
|
* @event
|
|
65
66
|
*/
|
|
66
67
|
RendererEvent.END = "endRender";
|
|
67
|
-
exports.RendererEvent = RendererEvent;
|
|
68
68
|
/**
|
|
69
69
|
* An event emitted by the {@link Renderer} class before and after the
|
|
70
70
|
* markup of a page is rendered.
|
|
@@ -83,6 +83,7 @@ class PageEvent extends events_1.Event {
|
|
|
83
83
|
this.model = model;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
exports.PageEvent = PageEvent;
|
|
86
87
|
/**
|
|
87
88
|
* Triggered before a document will be rendered.
|
|
88
89
|
* @event
|
|
@@ -93,11 +94,11 @@ PageEvent.BEGIN = "beginPage";
|
|
|
93
94
|
* @event
|
|
94
95
|
*/
|
|
95
96
|
PageEvent.END = "endPage";
|
|
96
|
-
exports.PageEvent = PageEvent;
|
|
97
97
|
/**
|
|
98
98
|
* An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
|
|
99
99
|
*
|
|
100
100
|
* @see {@link MarkdownEvent.PARSE}
|
|
101
|
+
* @see {@link MarkdownEvent.INCLUDE}
|
|
101
102
|
*/
|
|
102
103
|
class MarkdownEvent extends events_1.Event {
|
|
103
104
|
constructor(name, page, originalText, parsedText) {
|
|
@@ -107,12 +108,17 @@ class MarkdownEvent extends events_1.Event {
|
|
|
107
108
|
this.parsedText = parsedText;
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
exports.MarkdownEvent = MarkdownEvent;
|
|
110
112
|
/**
|
|
111
113
|
* Triggered on the renderer when this plugin parses a markdown string.
|
|
112
114
|
* @event
|
|
113
115
|
*/
|
|
114
116
|
MarkdownEvent.PARSE = "parseMarkdown";
|
|
115
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Triggered on the renderer when this plugin includes a markdown file through a markdown include tag.
|
|
119
|
+
* @event
|
|
120
|
+
*/
|
|
121
|
+
MarkdownEvent.INCLUDE = "includeMarkdown";
|
|
116
122
|
/**
|
|
117
123
|
* An event emitted when the search index is being prepared.
|
|
118
124
|
*/
|
|
@@ -144,9 +150,9 @@ class IndexEvent extends events_1.Event {
|
|
|
144
150
|
this.searchFields = Array.from({ length: this.searchResults.length }, () => ({}));
|
|
145
151
|
}
|
|
146
152
|
}
|
|
153
|
+
exports.IndexEvent = IndexEvent;
|
|
147
154
|
/**
|
|
148
155
|
* Triggered on the renderer when the search index is being prepared.
|
|
149
156
|
* @event
|
|
150
157
|
*/
|
|
151
158
|
IndexEvent.PREPARE_INDEX = "prepareIndex";
|
|
152
|
-
exports.IndexEvent = IndexEvent;
|
|
@@ -19,7 +19,7 @@ const path_1 = require("path");
|
|
|
19
19
|
* A plugin that copies the subdirectory ´assets´ from the current themes
|
|
20
20
|
* source folder to the output directory.
|
|
21
21
|
*/
|
|
22
|
-
let AssetsPlugin = class AssetsPlugin extends components_1.RendererComponent {
|
|
22
|
+
let AssetsPlugin = exports.AssetsPlugin = class AssetsPlugin extends components_1.RendererComponent {
|
|
23
23
|
/**
|
|
24
24
|
* Create a new AssetsPlugin instance.
|
|
25
25
|
*/
|
|
@@ -57,7 +57,6 @@ let AssetsPlugin = class AssetsPlugin extends components_1.RendererComponent {
|
|
|
57
57
|
__decorate([
|
|
58
58
|
(0, utils_1.BindOption)("customCss")
|
|
59
59
|
], AssetsPlugin.prototype, "customCss", void 0);
|
|
60
|
-
AssetsPlugin = __decorate([
|
|
60
|
+
exports.AssetsPlugin = AssetsPlugin = __decorate([
|
|
61
61
|
(0, components_1.Component)({ name: "assets" })
|
|
62
62
|
], AssetsPlugin);
|
|
63
|
-
exports.AssetsPlugin = AssetsPlugin;
|
|
@@ -42,7 +42,7 @@ const DefaultTheme_1 = require("../themes/default/DefaultTheme");
|
|
|
42
42
|
*
|
|
43
43
|
* The resulting javascript file can be used to build a simple search function.
|
|
44
44
|
*/
|
|
45
|
-
let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.RendererComponent {
|
|
45
|
+
let JavascriptIndexPlugin = exports.JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.RendererComponent {
|
|
46
46
|
/**
|
|
47
47
|
* Create a new JavascriptIndexPlugin instance.
|
|
48
48
|
*/
|
|
@@ -141,7 +141,6 @@ let JavascriptIndexPlugin = class JavascriptIndexPlugin extends components_1.Ren
|
|
|
141
141
|
__decorate([
|
|
142
142
|
(0, utils_1.BindOption)("searchInComments")
|
|
143
143
|
], JavascriptIndexPlugin.prototype, "searchComments", void 0);
|
|
144
|
-
JavascriptIndexPlugin = __decorate([
|
|
144
|
+
exports.JavascriptIndexPlugin = JavascriptIndexPlugin = __decorate([
|
|
145
145
|
(0, components_1.Component)({ name: "javascript-index" })
|
|
146
146
|
], JavascriptIndexPlugin);
|
|
147
|
-
exports.JavascriptIndexPlugin = JavascriptIndexPlugin;
|
|
@@ -145,6 +145,8 @@ export declare class Renderer extends ChildableComponent<Application, RendererCo
|
|
|
145
145
|
lightTheme: ShikiTheme;
|
|
146
146
|
/** @internal */
|
|
147
147
|
darkTheme: ShikiTheme;
|
|
148
|
+
/** @internal */
|
|
149
|
+
pretty: boolean;
|
|
148
150
|
renderStartTime: number;
|
|
149
151
|
/**
|
|
150
152
|
* Define a new theme that can be used to render output.
|
|
@@ -82,7 +82,7 @@ const type_1 = require("./themes/default/partials/type");
|
|
|
82
82
|
* Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive
|
|
83
83
|
* an instance of {@link IndexEvent}.
|
|
84
84
|
*/
|
|
85
|
-
let Renderer = class Renderer extends component_1.ChildableComponent {
|
|
85
|
+
let Renderer = exports.Renderer = class Renderer extends component_1.ChildableComponent {
|
|
86
86
|
constructor() {
|
|
87
87
|
super(...arguments);
|
|
88
88
|
this.themes = new Map([
|
|
@@ -139,6 +139,7 @@ let Renderer = class Renderer extends component_1.ChildableComponent {
|
|
|
139
139
|
* @param outputDirectory The path of the directory the documentation should be rendered to.
|
|
140
140
|
*/
|
|
141
141
|
async render(project, outputDirectory) {
|
|
142
|
+
(0, jsx_1.setRenderSettings)({ pretty: this.pretty });
|
|
142
143
|
const momento = this.hooks.saveMomento();
|
|
143
144
|
this.renderStartTime = Date.now();
|
|
144
145
|
await (0, highlighter_1.loadHighlighter)(this.lightTheme, this.darkTheme);
|
|
@@ -296,10 +297,13 @@ __decorate([
|
|
|
296
297
|
__decorate([
|
|
297
298
|
(0, utils_1.BindOption)("darkHighlightTheme")
|
|
298
299
|
], Renderer.prototype, "darkTheme", void 0);
|
|
299
|
-
|
|
300
|
+
__decorate([
|
|
301
|
+
(0, utils_1.BindOption)("pretty")
|
|
302
|
+
], Renderer.prototype, "pretty", void 0);
|
|
303
|
+
exports.Renderer = Renderer = __decorate([
|
|
300
304
|
(0, component_1.Component)({ name: "renderer", internal: true, childClass: components_1.RendererComponent })
|
|
301
305
|
], Renderer);
|
|
302
|
-
exports.Renderer = Renderer;
|
|
303
306
|
// HACK: THIS HAS TO STAY DOWN HERE
|
|
304
307
|
// if you try to move it up to the top of the file, then you'll run into stuff being used before it has been defined.
|
|
305
308
|
require("./plugins");
|
|
309
|
+
const jsx_1 = require("../utils/jsx");
|