typedoc 0.26.0-beta.0 → 0.26.0-beta.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/dist/lib/application.js +10 -1
- package/dist/lib/converter/comments/parser.js +3 -0
- package/dist/lib/converter/context.js +3 -0
- package/dist/lib/converter/converter.d.ts +2 -2
- package/dist/lib/converter/converter.js +39 -4
- package/dist/lib/converter/factories/signature.js +3 -3
- package/dist/lib/converter/plugins/CategoryPlugin.js +2 -2
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +2 -0
- package/dist/lib/converter/plugins/CommentPlugin.js +54 -2
- package/dist/lib/converter/symbols.js +0 -25
- package/dist/lib/internationalization/translatable.d.ts +7 -0
- package/dist/lib/internationalization/translatable.js +7 -0
- package/dist/lib/models/reflections/kind.d.ts +1 -0
- package/dist/lib/models/reflections/kind.js +1 -0
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +1 -1
- package/dist/lib/output/plugins/SitemapPlugin.js +4 -25
- package/dist/lib/output/renderer.d.ts +2 -0
- package/dist/lib/output/renderer.js +2 -0
- package/dist/lib/output/themes/MarkedPlugin.d.ts +4 -2
- package/dist/lib/output/themes/MarkedPlugin.js +21 -8
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +1 -1
- package/dist/lib/output/themes/default/DefaultTheme.js +8 -5
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +2 -2
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +1 -8
- package/dist/lib/output/themes/default/layouts/default.js +1 -1
- package/dist/lib/output/themes/default/partials/footer.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/footer.js +28 -16
- package/dist/lib/output/themes/default/partials/navigation.js +3 -4
- package/dist/lib/utils/jsx.elements.d.ts +1 -1
- package/dist/lib/utils/options/declaration.d.ts +11 -3
- package/dist/lib/utils/options/options.js +3 -0
- package/dist/lib/utils/options/readers/typedoc.d.ts +1 -1
- package/dist/lib/utils/options/readers/typedoc.js +1 -1
- package/dist/lib/utils/options/sources/typedoc.js +38 -0
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +4 -4
- package/dist/lib/utils/options/tsdoc-defaults.js +26 -21
- package/dist/lib/utils/set.d.ts +1 -0
- package/dist/lib/utils/set.js +12 -0
- package/package.json +1 -1
- package/static/style.css +28 -19
- package/tsdoc.json +13 -0
package/dist/lib/application.js
CHANGED
|
@@ -488,7 +488,16 @@ let Application = (() => {
|
|
|
488
488
|
// Generate a json file for each package
|
|
489
489
|
for (const dir of packageDirs) {
|
|
490
490
|
this.logger.verbose(`Reading project at ${(0, paths_1.nicePath)(dir)}`);
|
|
491
|
-
|
|
491
|
+
let opts;
|
|
492
|
+
try {
|
|
493
|
+
opts = origOptions.copyForPackage(dir);
|
|
494
|
+
}
|
|
495
|
+
catch (error) {
|
|
496
|
+
(0, assert_1.ok)(error instanceof Error);
|
|
497
|
+
this.logger.error(error.message);
|
|
498
|
+
this.logger.info(this.i18n.previous_error_occurred_when_reading_options_for_0((0, paths_1.nicePath)(dir)));
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
492
501
|
await opts.read(this.logger, dir);
|
|
493
502
|
// Invalid links should only be reported after everything has been merged.
|
|
494
503
|
opts.setValue("validation", { invalidLink: false });
|
|
@@ -226,6 +226,9 @@ const aliasedTags = new Map([["@return", "@returns"]]);
|
|
|
226
226
|
function blockTag(comment, lexer, config, i18n, warning) {
|
|
227
227
|
const blockTag = lexer.take();
|
|
228
228
|
(0, assert_1.ok)(blockTag.kind === lexer_1.TokenSyntaxKind.Tag, "blockTag called not at the start of a block tag."); // blockContent is broken if this fails.
|
|
229
|
+
if (!config.blockTags.has(blockTag.text)) {
|
|
230
|
+
warning(i18n.unknown_block_tag_0(blockTag.text), blockTag);
|
|
231
|
+
}
|
|
229
232
|
const tagName = aliasedTags.get(blockTag.text) || blockTag.text;
|
|
230
233
|
let content;
|
|
231
234
|
if (tagName === "@example") {
|
|
@@ -142,6 +142,9 @@ class Context {
|
|
|
142
142
|
}
|
|
143
143
|
finalizeDeclarationReflection(reflection) {
|
|
144
144
|
this.converter.trigger(converter_events_1.ConverterEvents.CREATE_DECLARATION, this, reflection);
|
|
145
|
+
if (reflection.kindOf(index_1.ReflectionKind.MayContainDocuments)) {
|
|
146
|
+
this.converter.processDocumentTags(reflection, reflection);
|
|
147
|
+
}
|
|
145
148
|
}
|
|
146
149
|
addChild(reflection) {
|
|
147
150
|
if (this.scope instanceof index_1.ContainerReflection) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import type { Application } from "../application";
|
|
3
|
-
import { Comment, type CommentDisplayPart, ProjectReflection, type Reflection, type ReflectionSymbolId, type SomeType } from "../models/index";
|
|
3
|
+
import { Comment, type CommentDisplayPart, type ContainerReflection, ProjectReflection, type Reflection, type ReflectionSymbolId, type SomeType } from "../models/index";
|
|
4
4
|
import { Context } from "./context";
|
|
5
5
|
import { ConverterComponent } from "./components";
|
|
6
6
|
import { ChildableComponent } from "../utils/component";
|
|
@@ -143,7 +143,6 @@ export declare class Converter extends ChildableComponent<Application, Converter
|
|
|
143
143
|
* reference passed will have the `moduleSource` set and the `symbolReference` will navigate via `.`)
|
|
144
144
|
* and user defined \{\@link\} tags which cannot be resolved. If the link being resolved is inferred
|
|
145
145
|
* from a type, then no `part` will be passed to the resolver function.
|
|
146
|
-
* @since 0.22.14
|
|
147
146
|
*/
|
|
148
147
|
addUnknownSymbolResolver(resolver: ExternalSymbolResolver): void;
|
|
149
148
|
/** @internal */
|
|
@@ -176,5 +175,6 @@ export declare class Converter extends ChildableComponent<Application, Converter
|
|
|
176
175
|
private isExcluded;
|
|
177
176
|
/** @internal */
|
|
178
177
|
isExternal(symbol: ts.Symbol): boolean;
|
|
178
|
+
processDocumentTags(reflection: Reflection, parent: ContainerReflection): void;
|
|
179
179
|
private _buildCommentParserConfig;
|
|
180
180
|
}
|
|
@@ -67,6 +67,7 @@ const enum_1 = require("../utils/enum");
|
|
|
67
67
|
const parser_1 = require("./comments/parser");
|
|
68
68
|
const rawLexer_1 = require("./comments/rawLexer");
|
|
69
69
|
const linkResolver_1 = require("./comments/linkResolver");
|
|
70
|
+
const path_1 = require("path");
|
|
70
71
|
/**
|
|
71
72
|
* Compiles source files using TypeScript and converts compiler symbols to reflections.
|
|
72
73
|
*/
|
|
@@ -257,7 +258,6 @@ let Converter = (() => {
|
|
|
257
258
|
* reference passed will have the `moduleSource` set and the `symbolReference` will navigate via `.`)
|
|
258
259
|
* and user defined \{\@link\} tags which cannot be resolved. If the link being resolved is inferred
|
|
259
260
|
* from a type, then no `part` will be passed to the resolver function.
|
|
260
|
-
* @since 0.22.14
|
|
261
261
|
*/
|
|
262
262
|
addUnknownSymbolResolver(resolver) {
|
|
263
263
|
this._externalSymbolResolvers.push(resolver);
|
|
@@ -291,9 +291,16 @@ let Converter = (() => {
|
|
|
291
291
|
context: undefined,
|
|
292
292
|
};
|
|
293
293
|
});
|
|
294
|
+
let createModuleReflections = entries.length > 1;
|
|
295
|
+
if (!createModuleReflections) {
|
|
296
|
+
const opts = this.application.options;
|
|
297
|
+
createModuleReflections = opts.isSet("alwaysCreateEntryPointModule")
|
|
298
|
+
? opts.getValue("alwaysCreateEntryPointModule")
|
|
299
|
+
: !!context.scope.documents;
|
|
300
|
+
}
|
|
294
301
|
entries.forEach((e) => {
|
|
295
302
|
context.setActiveProgram(e.entryPoint.program);
|
|
296
|
-
e.context = this.convertExports(context, e.entryPoint,
|
|
303
|
+
e.context = this.convertExports(context, e.entryPoint, createModuleReflections);
|
|
297
304
|
});
|
|
298
305
|
for (const { entryPoint, context } of entries) {
|
|
299
306
|
// active program is already set on context
|
|
@@ -304,18 +311,19 @@ let Converter = (() => {
|
|
|
304
311
|
}
|
|
305
312
|
context.setActiveProgram(undefined);
|
|
306
313
|
}
|
|
307
|
-
convertExports(context, entryPoint,
|
|
314
|
+
convertExports(context, entryPoint, createModuleReflections) {
|
|
308
315
|
const node = entryPoint.sourceFile;
|
|
309
316
|
const entryName = entryPoint.displayName;
|
|
310
317
|
const symbol = getSymbolForModuleLike(context, node);
|
|
311
318
|
let moduleContext;
|
|
312
|
-
if (
|
|
319
|
+
if (createModuleReflections === false) {
|
|
313
320
|
// Special case for when we're giving a single entry point, we don't need to
|
|
314
321
|
// create modules for each entry. Register the project as this module.
|
|
315
322
|
context.project.registerReflection(context.project, symbol);
|
|
316
323
|
context.project.comment = symbol
|
|
317
324
|
? context.getComment(symbol, context.project.kind)
|
|
318
325
|
: context.getFileComment(node);
|
|
326
|
+
this.processDocumentTags(context.project, context.project);
|
|
319
327
|
context.trigger(Converter.EVENT_CREATE_DECLARATION, context.project);
|
|
320
328
|
moduleContext = context;
|
|
321
329
|
}
|
|
@@ -381,6 +389,30 @@ let Converter = (() => {
|
|
|
381
389
|
const cache = this.externalPatternCache;
|
|
382
390
|
return (symbol.getDeclarations() ?? []).some((node) => (0, paths_1.matchesAny)(cache, node.getSourceFile().fileName));
|
|
383
391
|
}
|
|
392
|
+
processDocumentTags(reflection, parent) {
|
|
393
|
+
let relativeTo = reflection.comment?.sourcePath;
|
|
394
|
+
if (relativeTo) {
|
|
395
|
+
relativeTo = (0, path_1.dirname)(relativeTo);
|
|
396
|
+
const tags = reflection.comment?.getTags("@document") || [];
|
|
397
|
+
reflection.comment?.removeTags("@document");
|
|
398
|
+
for (const tag of tags) {
|
|
399
|
+
const path = index_1.Comment.combineDisplayParts(tag.content);
|
|
400
|
+
let file;
|
|
401
|
+
try {
|
|
402
|
+
const resolved = (0, path_1.resolve)(relativeTo, path);
|
|
403
|
+
file = new utils_1.MinimalSourceFile((0, utils_1.readFile)(resolved), resolved);
|
|
404
|
+
}
|
|
405
|
+
catch {
|
|
406
|
+
this.application.logger.warn(this.application.logger.i18n.failed_to_read_0_when_processing_document_tag_in_1((0, paths_1.nicePath)(path), (0, paths_1.nicePath)(reflection.comment.sourcePath)));
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const { content, frontmatter } = this.parseRawComment(file);
|
|
410
|
+
const docRefl = new index_1.DocumentReflection((0, path_1.basename)(file.fileName).replace(/\.[^.]+$/, ""), parent, content, frontmatter);
|
|
411
|
+
parent.addChild(docRefl);
|
|
412
|
+
parent.project.registerReflection(docRefl);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
384
416
|
_buildCommentParserConfig() {
|
|
385
417
|
this._config = {
|
|
386
418
|
blockTags: new Set(this.application.options.getValue("blockTags")),
|
|
@@ -388,6 +420,9 @@ let Converter = (() => {
|
|
|
388
420
|
modifierTags: new Set(this.application.options.getValue("modifierTags")),
|
|
389
421
|
jsDocCompatibility: this.application.options.getValue("jsDocCompatibility"),
|
|
390
422
|
};
|
|
423
|
+
// Can't be included in options because the TSDoc parser blows up if we do.
|
|
424
|
+
// TypeDoc supports it as one, so it should always be included here.
|
|
425
|
+
this._config.blockTags.add("@inheritDoc");
|
|
391
426
|
return this._config;
|
|
392
427
|
}
|
|
393
428
|
};
|
|
@@ -31,9 +31,6 @@ function createSignature(context, kind, signature, symbol, declaration) {
|
|
|
31
31
|
if (symbol && declaration) {
|
|
32
32
|
context.project.registerSymbolId(sigRef, new ReflectionSymbolId_1.ReflectionSymbolId(symbol, declaration));
|
|
33
33
|
}
|
|
34
|
-
// If we are creating signatures for a variable or property and it has a comment associated with it
|
|
35
|
-
// then we should prefer that comment over any comment on the signature. The comment plugin
|
|
36
|
-
// will copy the comment down if this signature doesn't have one, so don't set one.
|
|
37
34
|
let parentReflection = context.scope;
|
|
38
35
|
if (parentReflection.kindOf(models_1.ReflectionKind.TypeLiteral) &&
|
|
39
36
|
parentReflection.parent instanceof models_1.DeclarationReflection) {
|
|
@@ -43,6 +40,9 @@ function createSignature(context, kind, signature, symbol, declaration) {
|
|
|
43
40
|
const sigComment = context.getSignatureComment(declaration);
|
|
44
41
|
if (parentReflection.comment?.discoveryId !== sigComment?.discoveryId) {
|
|
45
42
|
sigRef.comment = sigComment;
|
|
43
|
+
if (parentReflection.kindOf(models_1.ReflectionKind.MayContainDocuments)) {
|
|
44
|
+
context.converter.processDocumentTags(sigRef, parentReflection);
|
|
45
|
+
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
sigRef.typeParameters = convertTypeParameters(sigRefCtx, sigRef, signature.typeParameters);
|
|
@@ -168,10 +168,10 @@ let CategoryPlugin = (() => {
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
lumpCategorize(obj) {
|
|
171
|
-
if (!obj.
|
|
171
|
+
if (!obj.childrenIncludingDocuments || obj.categories) {
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
|
-
obj.categories = this.getReflectionCategories(obj, obj.
|
|
174
|
+
obj.categories = this.getReflectionCategories(obj, obj.childrenIncludingDocuments);
|
|
175
175
|
if (obj.categories && obj.categories.length > 1) {
|
|
176
176
|
obj.categories.sort(CategoryPlugin.sortCatCallback);
|
|
177
177
|
}
|
|
@@ -57,6 +57,7 @@ import { ConverterComponent } from "../components";
|
|
|
57
57
|
*/
|
|
58
58
|
export declare class CommentPlugin extends ConverterComponent {
|
|
59
59
|
accessor excludeTags: `@${string}`[];
|
|
60
|
+
accessor cascadedModifierTags: `@${string}`[];
|
|
60
61
|
accessor excludeInternal: boolean;
|
|
61
62
|
accessor excludePrivate: boolean;
|
|
62
63
|
accessor excludeProtected: boolean;
|
|
@@ -114,6 +115,7 @@ export declare class CommentPlugin extends ConverterComponent {
|
|
|
114
115
|
private onResolve;
|
|
115
116
|
private moveSignatureParamComments;
|
|
116
117
|
private removeExcludedTags;
|
|
118
|
+
private cascadeModifiers;
|
|
117
119
|
/**
|
|
118
120
|
* Determines whether or not a reflection has been hidden
|
|
119
121
|
*
|
|
@@ -55,6 +55,7 @@ const converter_1 = require("../converter");
|
|
|
55
55
|
const models_1 = require("../../models");
|
|
56
56
|
const utils_1 = require("../../utils");
|
|
57
57
|
const CategoryPlugin_1 = require("./CategoryPlugin");
|
|
58
|
+
const set_1 = require("../../utils/set");
|
|
58
59
|
/**
|
|
59
60
|
* These tags are not useful to display in the generated documentation.
|
|
60
61
|
* They should be ignored when parsing comments. Any relevant type information
|
|
@@ -76,6 +77,17 @@ const NEVER_RENDERED = [
|
|
|
76
77
|
"@type",
|
|
77
78
|
"@typedef",
|
|
78
79
|
];
|
|
80
|
+
// We might make this user configurable at some point, but for now,
|
|
81
|
+
// this set is configured here.
|
|
82
|
+
const MUTUALLY_EXCLUSIVE_MODIFIERS = [
|
|
83
|
+
new Set([
|
|
84
|
+
"@alpha",
|
|
85
|
+
"@beta",
|
|
86
|
+
"@experimental",
|
|
87
|
+
"@internal",
|
|
88
|
+
"@public",
|
|
89
|
+
]),
|
|
90
|
+
];
|
|
79
91
|
/**
|
|
80
92
|
* Handles most behavior triggered by comments. `@group` and `@category` are handled by their respective plugins, but everything else is here.
|
|
81
93
|
*
|
|
@@ -133,7 +145,7 @@ const NEVER_RENDERED = [
|
|
|
133
145
|
*
|
|
134
146
|
*/
|
|
135
147
|
let CommentPlugin = (() => {
|
|
136
|
-
var _CommentPlugin_excludeTags_accessor_storage, _CommentPlugin_excludeInternal_accessor_storage, _CommentPlugin_excludePrivate_accessor_storage, _CommentPlugin_excludeProtected_accessor_storage, _CommentPlugin_excludeNotDocumented_accessor_storage, _CommentPlugin_excludeCategories_accessor_storage, _CommentPlugin_defaultCategory_accessor_storage;
|
|
148
|
+
var _CommentPlugin_excludeTags_accessor_storage, _CommentPlugin_cascadedModifierTags_accessor_storage, _CommentPlugin_excludeInternal_accessor_storage, _CommentPlugin_excludePrivate_accessor_storage, _CommentPlugin_excludeProtected_accessor_storage, _CommentPlugin_excludeNotDocumented_accessor_storage, _CommentPlugin_excludeCategories_accessor_storage, _CommentPlugin_defaultCategory_accessor_storage;
|
|
137
149
|
let _classDecorators = [(0, components_1.Component)({ name: "comment" })];
|
|
138
150
|
let _classDescriptor;
|
|
139
151
|
let _classExtraInitializers = [];
|
|
@@ -142,6 +154,9 @@ let CommentPlugin = (() => {
|
|
|
142
154
|
let _excludeTags_decorators;
|
|
143
155
|
let _excludeTags_initializers = [];
|
|
144
156
|
let _excludeTags_extraInitializers = [];
|
|
157
|
+
let _cascadedModifierTags_decorators;
|
|
158
|
+
let _cascadedModifierTags_initializers = [];
|
|
159
|
+
let _cascadedModifierTags_extraInitializers = [];
|
|
145
160
|
let _excludeInternal_decorators;
|
|
146
161
|
let _excludeInternal_initializers = [];
|
|
147
162
|
let _excludeInternal_extraInitializers = [];
|
|
@@ -164,7 +179,8 @@ let CommentPlugin = (() => {
|
|
|
164
179
|
constructor() {
|
|
165
180
|
super(...arguments);
|
|
166
181
|
_CommentPlugin_excludeTags_accessor_storage.set(this, __runInitializers(this, _excludeTags_initializers, void 0));
|
|
167
|
-
|
|
182
|
+
_CommentPlugin_cascadedModifierTags_accessor_storage.set(this, (__runInitializers(this, _excludeTags_extraInitializers), __runInitializers(this, _cascadedModifierTags_initializers, void 0)));
|
|
183
|
+
_CommentPlugin_excludeInternal_accessor_storage.set(this, (__runInitializers(this, _cascadedModifierTags_extraInitializers), __runInitializers(this, _excludeInternal_initializers, void 0)));
|
|
168
184
|
_CommentPlugin_excludePrivate_accessor_storage.set(this, (__runInitializers(this, _excludeInternal_extraInitializers), __runInitializers(this, _excludePrivate_initializers, void 0)));
|
|
169
185
|
_CommentPlugin_excludeProtected_accessor_storage.set(this, (__runInitializers(this, _excludePrivate_extraInitializers), __runInitializers(this, _excludeProtected_initializers, void 0)));
|
|
170
186
|
_CommentPlugin_excludeNotDocumented_accessor_storage.set(this, (__runInitializers(this, _excludeProtected_extraInitializers), __runInitializers(this, _excludeNotDocumented_initializers, void 0)));
|
|
@@ -174,6 +190,8 @@ let CommentPlugin = (() => {
|
|
|
174
190
|
}
|
|
175
191
|
get excludeTags() { return __classPrivateFieldGet(this, _CommentPlugin_excludeTags_accessor_storage, "f"); }
|
|
176
192
|
set excludeTags(value) { __classPrivateFieldSet(this, _CommentPlugin_excludeTags_accessor_storage, value, "f"); }
|
|
193
|
+
get cascadedModifierTags() { return __classPrivateFieldGet(this, _CommentPlugin_cascadedModifierTags_accessor_storage, "f"); }
|
|
194
|
+
set cascadedModifierTags(value) { __classPrivateFieldSet(this, _CommentPlugin_cascadedModifierTags_accessor_storage, value, "f"); }
|
|
177
195
|
get excludeInternal() { return __classPrivateFieldGet(this, _CommentPlugin_excludeInternal_accessor_storage, "f"); }
|
|
178
196
|
set excludeInternal(value) { __classPrivateFieldSet(this, _CommentPlugin_excludeInternal_accessor_storage, value, "f"); }
|
|
179
197
|
get excludePrivate() { return __classPrivateFieldGet(this, _CommentPlugin_excludePrivate_accessor_storage, "f"); }
|
|
@@ -296,6 +314,7 @@ let CommentPlugin = (() => {
|
|
|
296
314
|
* @param node The node that is currently processed if available.
|
|
297
315
|
*/
|
|
298
316
|
onDeclaration(_context, reflection) {
|
|
317
|
+
this.cascadeModifiers(reflection);
|
|
299
318
|
const comment = reflection.comment;
|
|
300
319
|
if (!comment)
|
|
301
320
|
return;
|
|
@@ -369,6 +388,13 @@ let CommentPlugin = (() => {
|
|
|
369
388
|
!/[A-Z_][A-Z0-9_]/.test(reflection.comment.label)) {
|
|
370
389
|
context.logger.warn(context.i18n.label_0_for_1_cannot_be_referenced(reflection.comment.label, reflection.getFriendlyFullName()));
|
|
371
390
|
}
|
|
391
|
+
for (const group of MUTUALLY_EXCLUSIVE_MODIFIERS) {
|
|
392
|
+
const intersect = (0, set_1.setIntersection)(group, reflection.comment.modifierTags);
|
|
393
|
+
if (intersect.size > 1) {
|
|
394
|
+
const [a, b] = intersect;
|
|
395
|
+
context.logger.warn(context.i18n.modifier_tag_0_is_mutually_exclusive_with_1_in_comment_for_2(a, b, reflection.getFriendlyFullName()));
|
|
396
|
+
}
|
|
397
|
+
}
|
|
372
398
|
mergeSeeTags(reflection.comment);
|
|
373
399
|
movePropertyTags(reflection.comment, reflection);
|
|
374
400
|
}
|
|
@@ -393,6 +419,13 @@ let CommentPlugin = (() => {
|
|
|
393
419
|
reflection.comment.removeTags("@returns");
|
|
394
420
|
}
|
|
395
421
|
}
|
|
422
|
+
// Any cascaded tags will show up twice, once on this and once on our signatures
|
|
423
|
+
// This is completely redundant, so remove them from the wrapping function.
|
|
424
|
+
if (sigs.length) {
|
|
425
|
+
for (const mod of this.cascadedModifierTags) {
|
|
426
|
+
reflection.comment.modifierTags.delete(mod);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
396
429
|
}
|
|
397
430
|
if (reflection instanceof models_1.SignatureReflection) {
|
|
398
431
|
this.moveSignatureParamComments(reflection);
|
|
@@ -439,6 +472,22 @@ let CommentPlugin = (() => {
|
|
|
439
472
|
comment.removeModifier(tag);
|
|
440
473
|
}
|
|
441
474
|
}
|
|
475
|
+
cascadeModifiers(reflection) {
|
|
476
|
+
const parentComment = reflection.parent?.comment;
|
|
477
|
+
if (!parentComment)
|
|
478
|
+
return;
|
|
479
|
+
const childMods = reflection.comment?.modifierTags ?? new Set();
|
|
480
|
+
for (const mod of this.cascadedModifierTags) {
|
|
481
|
+
if (parentComment.hasModifier(mod)) {
|
|
482
|
+
const exclusiveSet = MUTUALLY_EXCLUSIVE_MODIFIERS.find((tags) => tags.has(mod));
|
|
483
|
+
if (!exclusiveSet ||
|
|
484
|
+
Array.from(exclusiveSet).every((tag) => !childMods.has(tag))) {
|
|
485
|
+
reflection.comment ||= new models_1.Comment();
|
|
486
|
+
reflection.comment.modifierTags.add(mod);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
442
491
|
/**
|
|
443
492
|
* Determines whether or not a reflection has been hidden
|
|
444
493
|
*
|
|
@@ -534,6 +583,7 @@ let CommentPlugin = (() => {
|
|
|
534
583
|
}
|
|
535
584
|
};
|
|
536
585
|
_CommentPlugin_excludeTags_accessor_storage = new WeakMap();
|
|
586
|
+
_CommentPlugin_cascadedModifierTags_accessor_storage = new WeakMap();
|
|
537
587
|
_CommentPlugin_excludeInternal_accessor_storage = new WeakMap();
|
|
538
588
|
_CommentPlugin_excludePrivate_accessor_storage = new WeakMap();
|
|
539
589
|
_CommentPlugin_excludeProtected_accessor_storage = new WeakMap();
|
|
@@ -544,6 +594,7 @@ let CommentPlugin = (() => {
|
|
|
544
594
|
(() => {
|
|
545
595
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
546
596
|
_excludeTags_decorators = [(0, utils_1.Option)("excludeTags")];
|
|
597
|
+
_cascadedModifierTags_decorators = [(0, utils_1.Option)("cascadedModifierTags")];
|
|
547
598
|
_excludeInternal_decorators = [(0, utils_1.Option)("excludeInternal")];
|
|
548
599
|
_excludePrivate_decorators = [(0, utils_1.Option)("excludePrivate")];
|
|
549
600
|
_excludeProtected_decorators = [(0, utils_1.Option)("excludeProtected")];
|
|
@@ -551,6 +602,7 @@ let CommentPlugin = (() => {
|
|
|
551
602
|
_excludeCategories_decorators = [(0, utils_1.Option)("excludeCategories")];
|
|
552
603
|
_defaultCategory_decorators = [(0, utils_1.Option)("defaultCategory")];
|
|
553
604
|
__esDecorate(_classThis, null, _excludeTags_decorators, { kind: "accessor", name: "excludeTags", static: false, private: false, access: { has: obj => "excludeTags" in obj, get: obj => obj.excludeTags, set: (obj, value) => { obj.excludeTags = value; } }, metadata: _metadata }, _excludeTags_initializers, _excludeTags_extraInitializers);
|
|
605
|
+
__esDecorate(_classThis, null, _cascadedModifierTags_decorators, { kind: "accessor", name: "cascadedModifierTags", static: false, private: false, access: { has: obj => "cascadedModifierTags" in obj, get: obj => obj.cascadedModifierTags, set: (obj, value) => { obj.cascadedModifierTags = value; } }, metadata: _metadata }, _cascadedModifierTags_initializers, _cascadedModifierTags_extraInitializers);
|
|
554
606
|
__esDecorate(_classThis, null, _excludeInternal_decorators, { kind: "accessor", name: "excludeInternal", static: false, private: false, access: { has: obj => "excludeInternal" in obj, get: obj => obj.excludeInternal, set: (obj, value) => { obj.excludeInternal = value; } }, metadata: _metadata }, _excludeInternal_initializers, _excludeInternal_extraInitializers);
|
|
555
607
|
__esDecorate(_classThis, null, _excludePrivate_decorators, { kind: "accessor", name: "excludePrivate", static: false, private: false, access: { has: obj => "excludePrivate" in obj, get: obj => obj.excludePrivate, set: (obj, value) => { obj.excludePrivate = value; } }, metadata: _metadata }, _excludePrivate_initializers, _excludePrivate_extraInitializers);
|
|
556
608
|
__esDecorate(_classThis, null, _excludeProtected_decorators, { kind: "accessor", name: "excludeProtected", static: false, private: false, access: { has: obj => "excludeProtected" in obj, get: obj => obj.excludeProtected, set: (obj, value) => { obj.excludeProtected = value; } }, metadata: _metadata }, _excludeProtected_initializers, _excludeProtected_extraInitializers);
|
|
@@ -14,9 +14,6 @@ const signature_1 = require("./factories/signature");
|
|
|
14
14
|
const jsdoc_1 = require("./jsdoc");
|
|
15
15
|
const nodes_1 = require("./utils/nodes");
|
|
16
16
|
const reflections_1 = require("./utils/reflections");
|
|
17
|
-
const path_1 = require("path");
|
|
18
|
-
const utils_1 = require("../utils");
|
|
19
|
-
const paths_1 = require("../utils/paths");
|
|
20
17
|
const symbolConverters = {
|
|
21
18
|
[typescript_1.default.SymbolFlags.RegularEnum]: convertEnum,
|
|
22
19
|
[typescript_1.default.SymbolFlags.ConstEnum]: convertEnum,
|
|
@@ -180,28 +177,6 @@ function convertNamespace(context, symbol, exportSymbol) {
|
|
|
180
177
|
else {
|
|
181
178
|
reflection = context.createDeclarationReflection(models_1.ReflectionKind.Namespace, symbol, exportSymbol);
|
|
182
179
|
context.finalizeDeclarationReflection(reflection);
|
|
183
|
-
let relativeTo = reflection.comment?.sourcePath;
|
|
184
|
-
if (relativeTo) {
|
|
185
|
-
relativeTo = (0, path_1.dirname)(relativeTo);
|
|
186
|
-
const tags = reflection.comment?.getTags("@document") || [];
|
|
187
|
-
reflection.comment?.removeTags("@document");
|
|
188
|
-
for (const tag of tags) {
|
|
189
|
-
const path = models_1.Comment.combineDisplayParts(tag.content);
|
|
190
|
-
let file;
|
|
191
|
-
try {
|
|
192
|
-
const resolved = (0, path_1.resolve)(relativeTo, path);
|
|
193
|
-
file = new utils_1.MinimalSourceFile((0, utils_1.readFile)(resolved), resolved);
|
|
194
|
-
}
|
|
195
|
-
catch {
|
|
196
|
-
context.logger.warn(context.logger.i18n.failed_to_read_0_when_processing_document_tag_in_1((0, paths_1.nicePath)(path), (0, paths_1.nicePath)(reflection.comment.sourcePath)));
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
const { content, frontmatter } = context.converter.parseRawComment(file);
|
|
200
|
-
const docRefl = new models_1.DocumentReflection((0, path_1.basename)(file.fileName).replace(/\.[^.]+$/, ""), reflection, content, frontmatter);
|
|
201
|
-
reflection.addChild(docRefl);
|
|
202
|
-
context.project.registerReflection(docRefl);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
180
|
}
|
|
206
181
|
convertSymbols(context.withScope(reflection), context.checker
|
|
207
182
|
.getExportsOfModule(symbol)
|
|
@@ -13,6 +13,7 @@ export declare const translatable: {
|
|
|
13
13
|
readonly no_entry_points_for_packages: "No entry points provided to packages mode, documentation cannot be generated.";
|
|
14
14
|
readonly failed_to_find_packages: "Failed to find any packages, ensure you have provided at least one directory as an entry point containing package.json";
|
|
15
15
|
readonly nested_packages_unsupported_0: "Project at {0} has entryPointStrategy set to packages, but nested packages are not supported.";
|
|
16
|
+
readonly previous_error_occurred_when_reading_options_for_0: "The previous error occurred when reading options for the package at {0}";
|
|
16
17
|
readonly converting_project_at_0: "Converting project at {0}";
|
|
17
18
|
readonly failed_to_convert_packages: "Failed to convert one or more packages, result will not be merged together.";
|
|
18
19
|
readonly merging_converted_projects: "Merging converted projects";
|
|
@@ -38,6 +39,7 @@ export declare const translatable: {
|
|
|
38
39
|
readonly treating_unrecognized_tag_0_as_modifier: "Treating unrecognized tag {0} as a modifier tag.";
|
|
39
40
|
readonly unmatched_closing_brace: "Unmatched closing brace.";
|
|
40
41
|
readonly unescaped_open_brace_without_inline_tag: "Encountered an unescaped open brace without an inline tag.";
|
|
42
|
+
readonly unknown_block_tag_0: "Encountered an unknown block tag {0}.";
|
|
41
43
|
readonly unknown_inline_tag_0: "Encountered an unknown inline tag {0}.";
|
|
42
44
|
readonly open_brace_within_inline_tag: "Encountered an open brace within an inline tag, this is likely a mistake.";
|
|
43
45
|
readonly inline_tag_not_closed: "Inline tag is not closed.";
|
|
@@ -50,6 +52,7 @@ export declare const translatable: {
|
|
|
50
52
|
readonly comment_for_0_includes_categoryDescription_for_1_but_no_child_in_group: "Comment for {0} includes @categoryDescription for \"{1}\", but no child is placed in that category.";
|
|
51
53
|
readonly comment_for_0_includes_groupDescription_for_1_but_no_child_in_group: "Comment for {0} includes @groupDescription for \"{1}\", but no child is placed in that group.";
|
|
52
54
|
readonly label_0_for_1_cannot_be_referenced: "The label \"{0}\" for {1} cannot be referenced with a declaration reference. Labels may only contain A-Z, 0-9, and _, and may not start with a number.";
|
|
55
|
+
readonly modifier_tag_0_is_mutually_exclusive_with_1_in_comment_for_2: "The modifier tag {0} is mutually exclusive with {1} in the comment for {2}.";
|
|
53
56
|
readonly signature_0_has_unused_param_with_name_1: "The signature {0} has an @param with name \"{1}\", which was not used.";
|
|
54
57
|
readonly declaration_reference_in_inheritdoc_for_0_not_fully_parsed: "Declaration reference in @inheritDoc for {0} was not fully parsed and may resolve incorrectly.";
|
|
55
58
|
readonly failed_to_find_0_to_inherit_comment_from_in_1: "Failed to find \"{0}\" to inherit the comment from in the comment for {1}";
|
|
@@ -102,8 +105,10 @@ export declare const translatable: {
|
|
|
102
105
|
readonly help_compilerOptions: "Selectively override the TypeScript compiler options used by TypeDoc.";
|
|
103
106
|
readonly help_lang: "Sets the language to be used in generation and in TypeDoc's messages.";
|
|
104
107
|
readonly help_locales: "Add translations for a specified locale. This option is primarily intended to be used as a stopgap while waiting for official locale support to be added to TypeDoc.";
|
|
108
|
+
readonly help_packageOptions: "Set options which will be set within each package when entryPointStrategy is set to packages.";
|
|
105
109
|
readonly help_entryPoints: "The entry points of your documentation.";
|
|
106
110
|
readonly help_entryPointStrategy: "The strategy to be used to convert entry points into documentation modules.";
|
|
111
|
+
readonly help_alwaysCreateEntryPointModule: "When set, TypeDoc will always create a `Module` for entry points, even if only one is provided.";
|
|
107
112
|
readonly help_projectDocuments: "Documents which should be added as children to the root of the generated documentation. Supports globs to match multiple files.";
|
|
108
113
|
readonly help_exclude: "Define patterns to be excluded when expanding a directory that was specified as an entry point.";
|
|
109
114
|
readonly help_externalPattern: "Define patterns for files that should be considered being external.";
|
|
@@ -143,6 +148,8 @@ export declare const translatable: {
|
|
|
143
148
|
readonly help_hostedBaseUrl: "Specify a base URL to be used in generating a sitemap.xml in our output folder and canonical links. If not specified, no sitemap will be generated.";
|
|
144
149
|
readonly help_gaID: "Set the Google Analytics tracking ID and activate tracking code.";
|
|
145
150
|
readonly help_hideGenerator: "Do not print the TypeDoc link at the end of the page.";
|
|
151
|
+
readonly help_customFooterHtml: "Custom footer after the TypeDoc link.";
|
|
152
|
+
readonly help_customFooterHtmlDisableWrapper: "If set, disables the wrapper element for customFooterHtml.";
|
|
146
153
|
readonly help_hideParameterTypesInTitle: "Hides parameter types in signature titles for easier scanning.";
|
|
147
154
|
readonly help_cacheBust: "Include the generation time in links to static assets.";
|
|
148
155
|
readonly help_searchInComments: "If set, the search index will also include comments. This will greatly increase the size of the search index.";
|
|
@@ -22,6 +22,7 @@ exports.translatable = {
|
|
|
22
22
|
no_entry_points_for_packages: "No entry points provided to packages mode, documentation cannot be generated.",
|
|
23
23
|
failed_to_find_packages: "Failed to find any packages, ensure you have provided at least one directory as an entry point containing package.json",
|
|
24
24
|
nested_packages_unsupported_0: "Project at {0} has entryPointStrategy set to packages, but nested packages are not supported.",
|
|
25
|
+
previous_error_occurred_when_reading_options_for_0: "The previous error occurred when reading options for the package at {0}",
|
|
25
26
|
converting_project_at_0: "Converting project at {0}",
|
|
26
27
|
failed_to_convert_packages: "Failed to convert one or more packages, result will not be merged together.",
|
|
27
28
|
merging_converted_projects: "Merging converted projects",
|
|
@@ -48,6 +49,7 @@ exports.translatable = {
|
|
|
48
49
|
treating_unrecognized_tag_0_as_modifier: `Treating unrecognized tag {0} as a modifier tag.`,
|
|
49
50
|
unmatched_closing_brace: `Unmatched closing brace.`,
|
|
50
51
|
unescaped_open_brace_without_inline_tag: `Encountered an unescaped open brace without an inline tag.`,
|
|
52
|
+
unknown_block_tag_0: `Encountered an unknown block tag {0}.`,
|
|
51
53
|
unknown_inline_tag_0: `Encountered an unknown inline tag {0}.`,
|
|
52
54
|
open_brace_within_inline_tag: `Encountered an open brace within an inline tag, this is likely a mistake.`,
|
|
53
55
|
inline_tag_not_closed: `Inline tag is not closed.`,
|
|
@@ -62,6 +64,7 @@ exports.translatable = {
|
|
|
62
64
|
comment_for_0_includes_categoryDescription_for_1_but_no_child_in_group: `Comment for {0} includes @categoryDescription for "{1}", but no child is placed in that category.`,
|
|
63
65
|
comment_for_0_includes_groupDescription_for_1_but_no_child_in_group: `Comment for {0} includes @groupDescription for "{1}", but no child is placed in that group.`,
|
|
64
66
|
label_0_for_1_cannot_be_referenced: `The label "{0}" for {1} cannot be referenced with a declaration reference. Labels may only contain A-Z, 0-9, and _, and may not start with a number.`,
|
|
67
|
+
modifier_tag_0_is_mutually_exclusive_with_1_in_comment_for_2: `The modifier tag {0} is mutually exclusive with {1} in the comment for {2}.`,
|
|
65
68
|
signature_0_has_unused_param_with_name_1: `The signature {0} has an @param with name "{1}", which was not used.`,
|
|
66
69
|
declaration_reference_in_inheritdoc_for_0_not_fully_parsed: `Declaration reference in @inheritDoc for {0} was not fully parsed and may resolve incorrectly.`,
|
|
67
70
|
failed_to_find_0_to_inherit_comment_from_in_1: `Failed to find "{0}" to inherit the comment from in the comment for {1}`,
|
|
@@ -121,8 +124,10 @@ exports.translatable = {
|
|
|
121
124
|
help_compilerOptions: "Selectively override the TypeScript compiler options used by TypeDoc.",
|
|
122
125
|
help_lang: "Sets the language to be used in generation and in TypeDoc's messages.",
|
|
123
126
|
help_locales: "Add translations for a specified locale. This option is primarily intended to be used as a stopgap while waiting for official locale support to be added to TypeDoc.",
|
|
127
|
+
help_packageOptions: "Set options which will be set within each package when entryPointStrategy is set to packages.",
|
|
124
128
|
help_entryPoints: "The entry points of your documentation.",
|
|
125
129
|
help_entryPointStrategy: "The strategy to be used to convert entry points into documentation modules.",
|
|
130
|
+
help_alwaysCreateEntryPointModule: "When set, TypeDoc will always create a `Module` for entry points, even if only one is provided.",
|
|
126
131
|
help_projectDocuments: "Documents which should be added as children to the root of the generated documentation. Supports globs to match multiple files.",
|
|
127
132
|
help_exclude: "Define patterns to be excluded when expanding a directory that was specified as an entry point.",
|
|
128
133
|
help_externalPattern: "Define patterns for files that should be considered being external.",
|
|
@@ -162,6 +167,8 @@ exports.translatable = {
|
|
|
162
167
|
help_hostedBaseUrl: "Specify a base URL to be used in generating a sitemap.xml in our output folder and canonical links. If not specified, no sitemap will be generated.",
|
|
163
168
|
help_gaID: "Set the Google Analytics tracking ID and activate tracking code.",
|
|
164
169
|
help_hideGenerator: "Do not print the TypeDoc link at the end of the page.",
|
|
170
|
+
help_customFooterHtml: "Custom footer after the TypeDoc link.",
|
|
171
|
+
help_customFooterHtmlDisableWrapper: "If set, disables the wrapper element for customFooterHtml.",
|
|
165
172
|
help_hideParameterTypesInTitle: "Hides parameter types in signature titles for easier scanning.",
|
|
166
173
|
help_cacheBust: "Include the generation time in links to static assets.",
|
|
167
174
|
help_searchInComments: "If set, the search index will also include comments. This will greatly increase the size of the search index.",
|
|
@@ -79,6 +79,7 @@ var ReflectionKind;
|
|
|
79
79
|
ReflectionKind.Interface |
|
|
80
80
|
ReflectionKind.TypeAlias |
|
|
81
81
|
ReflectionKind.Reference;
|
|
82
|
+
ReflectionKind.MayContainDocuments = ReflectionKind.SomeExport | ReflectionKind.Project;
|
|
82
83
|
/** @internal */
|
|
83
84
|
ReflectionKind.ExportContainer = ReflectionKind.SomeModule | ReflectionKind.Project;
|
|
84
85
|
/** @internal */
|
|
@@ -37,17 +37,6 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
|
|
|
37
37
|
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
38
|
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
39
39
|
};
|
|
40
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
41
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
42
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
43
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
44
|
-
};
|
|
45
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
46
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
47
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
48
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
49
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
50
|
-
};
|
|
51
40
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
41
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
42
|
};
|
|
@@ -61,18 +50,16 @@ const utils_1 = require("../../utils");
|
|
|
61
50
|
const html_1 = require("../../utils/html");
|
|
62
51
|
const jsx_1 = require("../../utils/jsx");
|
|
63
52
|
let SitemapPlugin = (() => {
|
|
64
|
-
var _SitemapPlugin_hostedBaseUrl_accessor_storage;
|
|
65
53
|
let _classDecorators = [(0, components_1.Component)({ name: "sitemap" })];
|
|
66
54
|
let _classDescriptor;
|
|
67
55
|
let _classExtraInitializers = [];
|
|
68
56
|
let _classThis;
|
|
69
57
|
let _classSuper = components_1.RendererComponent;
|
|
70
|
-
let _hostedBaseUrl_decorators;
|
|
71
|
-
let _hostedBaseUrl_initializers = [];
|
|
72
|
-
let _hostedBaseUrl_extraInitializers = [];
|
|
73
58
|
var SitemapPlugin = _classThis = class extends _classSuper {
|
|
74
|
-
get hostedBaseUrl() {
|
|
75
|
-
|
|
59
|
+
get hostedBaseUrl() {
|
|
60
|
+
const url = this.application.options.getValue("hostedBaseUrl");
|
|
61
|
+
return !url || url.endsWith("/") ? url : url + "/";
|
|
62
|
+
}
|
|
76
63
|
initialize() {
|
|
77
64
|
this.listenTo(this.owner, events_1.RendererEvent.BEGIN, this.onRendererBegin);
|
|
78
65
|
}
|
|
@@ -123,18 +110,10 @@ let SitemapPlugin = (() => {
|
|
|
123
110
|
"\n";
|
|
124
111
|
await (0, utils_1.writeFile)(sitemapXml, sitemap);
|
|
125
112
|
}
|
|
126
|
-
constructor() {
|
|
127
|
-
super(...arguments);
|
|
128
|
-
_SitemapPlugin_hostedBaseUrl_accessor_storage.set(this, __runInitializers(this, _hostedBaseUrl_initializers, void 0));
|
|
129
|
-
__runInitializers(this, _hostedBaseUrl_extraInitializers);
|
|
130
|
-
}
|
|
131
113
|
};
|
|
132
|
-
_SitemapPlugin_hostedBaseUrl_accessor_storage = new WeakMap();
|
|
133
114
|
__setFunctionName(_classThis, "SitemapPlugin");
|
|
134
115
|
(() => {
|
|
135
116
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
136
|
-
_hostedBaseUrl_decorators = [(0, utils_1.Option)("hostedBaseUrl")];
|
|
137
|
-
__esDecorate(_classThis, null, _hostedBaseUrl_decorators, { kind: "accessor", name: "hostedBaseUrl", static: false, private: false, access: { has: obj => "hostedBaseUrl" in obj, get: obj => obj.hostedBaseUrl, set: (obj, value) => { obj.hostedBaseUrl = value; } }, metadata: _metadata }, _hostedBaseUrl_initializers, _hostedBaseUrl_extraInitializers);
|
|
138
117
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
139
118
|
SitemapPlugin = _classThis = _classDescriptor.value;
|
|
140
119
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
@@ -93,6 +93,8 @@ export interface RendererHooks {
|
|
|
93
93
|
* * {@link Renderer.EVENT_PREPARE_INDEX}<br>
|
|
94
94
|
* Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive
|
|
95
95
|
* an instance of {@link IndexEvent}.
|
|
96
|
+
*
|
|
97
|
+
* @document ../../../internal-docs/custom-themes.md
|
|
96
98
|
*/
|
|
97
99
|
export declare class Renderer extends ChildableComponent<Application, RendererComponent> {
|
|
98
100
|
private themes;
|
|
@@ -124,6 +124,8 @@ const jsx_1 = require("../utils/jsx");
|
|
|
124
124
|
* * {@link Renderer.EVENT_PREPARE_INDEX}<br>
|
|
125
125
|
* Triggered when the JavascriptIndexPlugin is preparing the search index. Listeners receive
|
|
126
126
|
* an instance of {@link IndexEvent}.
|
|
127
|
+
*
|
|
128
|
+
* @document ../../../internal-docs/custom-themes.md
|
|
127
129
|
*/
|
|
128
130
|
let Renderer = (() => {
|
|
129
131
|
var _Renderer_themeName_accessor_storage, _Renderer_cleanOutputDir_accessor_storage, _Renderer_cname_accessor_storage, _Renderer_githubPages_accessor_storage, _Renderer_cacheBust_accessor_storage, _Renderer_lightTheme_accessor_storage, _Renderer_darkTheme_accessor_storage, _Renderer_pretty_accessor_storage;
|
|
@@ -2,6 +2,7 @@ import { ContextAwareRendererComponent } from "../components";
|
|
|
2
2
|
import { type RendererEvent, MarkdownEvent, type PageEvent } from "../events";
|
|
3
3
|
import type { BundledTheme } from "shiki" with { "resolution-mode": "import" };
|
|
4
4
|
import type { DefaultThemeRenderContext } from "..";
|
|
5
|
+
import { type CommentDisplayPart } from "../../models";
|
|
5
6
|
/**
|
|
6
7
|
* Implements markdown and relativeURL helpers for templates.
|
|
7
8
|
* @internal
|
|
@@ -9,6 +10,7 @@ import type { DefaultThemeRenderContext } from "..";
|
|
|
9
10
|
export declare class MarkedPlugin extends ContextAwareRendererComponent {
|
|
10
11
|
accessor lightTheme: BundledTheme;
|
|
11
12
|
accessor darkTheme: BundledTheme;
|
|
13
|
+
accessor markdownItOptions: Record<string, unknown>;
|
|
12
14
|
private parser?;
|
|
13
15
|
/**
|
|
14
16
|
* This needing to be here really feels hacky... probably some nicer way to do this.
|
|
@@ -31,10 +33,10 @@ export declare class MarkedPlugin extends ContextAwareRendererComponent {
|
|
|
31
33
|
/**
|
|
32
34
|
* Parse the given markdown string and return the resulting html.
|
|
33
35
|
*
|
|
34
|
-
* @param
|
|
36
|
+
* @param input The markdown string that should be parsed.
|
|
35
37
|
* @returns The resulting html string.
|
|
36
38
|
*/
|
|
37
|
-
parseMarkdown(
|
|
39
|
+
parseMarkdown(input: string | readonly CommentDisplayPart[], page: PageEvent<any>, context: DefaultThemeRenderContext): string;
|
|
38
40
|
/**
|
|
39
41
|
* Triggered before the renderer starts rendering a project.
|
|
40
42
|
*
|