typedoc 0.25.13 → 0.26.0-beta.0
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/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/lib/application.d.ts +15 -3
- package/dist/lib/application.js +65 -23
- package/dist/lib/cli.js +1 -1
- package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
- package/dist/lib/converter/comments/blockLexer.js +1 -2
- package/dist/lib/converter/comments/declarationReference.js +8 -8
- package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +1 -1
- package/dist/lib/converter/comments/declarationReferenceResolver.js +15 -14
- package/dist/lib/converter/comments/discovery.d.ts +3 -3
- package/dist/lib/converter/comments/discovery.js +21 -19
- package/dist/lib/converter/comments/index.d.ts +1 -1
- package/dist/lib/converter/comments/index.js +35 -16
- package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
- package/dist/lib/converter/comments/lineLexer.js +1 -2
- package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
- package/dist/lib/converter/comments/linkResolver.js +5 -3
- package/dist/lib/converter/comments/parser.d.ts +14 -3
- package/dist/lib/converter/comments/parser.js +144 -39
- package/dist/lib/converter/comments/rawLexer.d.ts +7 -1
- package/dist/lib/converter/comments/rawLexer.js +21 -70
- package/dist/lib/converter/comments/tagName.js +1 -2
- package/dist/lib/converter/context.d.ts +7 -2
- package/dist/lib/converter/context.js +7 -2
- package/dist/lib/converter/convert-expression.js +2 -3
- package/dist/lib/converter/converter.d.ts +8 -3
- package/dist/lib/converter/converter.js +16 -13
- package/dist/lib/converter/factories/index-signature.d.ts +1 -1
- package/dist/lib/converter/factories/index-signature.js +9 -12
- package/dist/lib/converter/factories/signature.d.ts +1 -1
- package/dist/lib/converter/factories/signature.js +11 -12
- package/dist/lib/converter/jsdoc.js +2 -3
- package/dist/lib/converter/plugins/CategoryPlugin.d.ts +3 -3
- package/dist/lib/converter/plugins/CategoryPlugin.js +22 -15
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/CommentPlugin.js +58 -67
- package/dist/lib/converter/plugins/GroupPlugin.d.ts +4 -4
- package/dist/lib/converter/plugins/GroupPlugin.js +52 -18
- package/dist/lib/converter/plugins/ImplementsPlugin.js +4 -3
- package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +1 -1
- package/dist/lib/converter/plugins/InheritDocPlugin.js +5 -6
- package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +2 -2
- package/dist/lib/converter/plugins/PackagePlugin.d.ts +0 -2
- package/dist/lib/converter/plugins/PackagePlugin.js +8 -30
- package/dist/lib/converter/plugins/SourcePlugin.js +2 -2
- package/dist/lib/converter/symbols.js +31 -11
- package/dist/lib/converter/types.d.ts +1 -1
- package/dist/lib/converter/types.js +4 -5
- package/dist/lib/converter/utils/nodes.js +3 -4
- package/dist/lib/converter/utils/reflections.d.ts +1 -1
- package/dist/lib/converter/utils/reflections.js +1 -2
- package/dist/lib/converter/utils/repository.js +4 -4
- package/dist/lib/converter/utils/symbols.js +1 -2
- package/dist/lib/internationalization/index.d.ts +7 -0
- package/dist/lib/internationalization/index.js +11 -0
- package/dist/lib/internationalization/internationalization.d.ts +92 -0
- package/dist/lib/internationalization/internationalization.js +194 -0
- package/dist/lib/internationalization/locales/en.cjs +3 -0
- package/dist/lib/internationalization/locales/en.d.cts +2 -0
- package/dist/lib/internationalization/locales/test.cjs +8 -0
- package/dist/lib/internationalization/locales/test.d.cts +5 -0
- package/dist/lib/internationalization/translatable.d.ts +297 -0
- package/dist/lib/internationalization/translatable.js +322 -0
- package/dist/lib/models/ReflectionCategory.d.ts +2 -2
- package/dist/lib/models/ReflectionGroup.d.ts +2 -2
- package/dist/lib/models/comments/comment.d.ts +17 -3
- package/dist/lib/models/comments/comment.js +377 -298
- package/dist/lib/models/reflections/ReflectionSymbolId.js +2 -2
- package/dist/lib/models/reflections/abstract.d.ts +11 -8
- package/dist/lib/models/reflections/abstract.js +17 -11
- package/dist/lib/models/reflections/container.d.ts +25 -3
- package/dist/lib/models/reflections/container.js +64 -0
- package/dist/lib/models/reflections/declaration.d.ts +3 -15
- package/dist/lib/models/reflections/declaration.js +16 -21
- package/dist/lib/models/reflections/document.d.ts +27 -0
- package/dist/lib/models/reflections/document.js +43 -0
- package/dist/lib/models/reflections/index.d.ts +4 -3
- package/dist/lib/models/reflections/index.js +5 -4
- package/dist/lib/models/reflections/kind.d.ts +13 -1
- package/dist/lib/models/reflections/kind.js +12 -0
- package/dist/lib/models/reflections/parameter.d.ts +1 -1
- package/dist/lib/models/reflections/project.d.ts +2 -2
- package/dist/lib/models/reflections/project.js +8 -7
- package/dist/lib/models/reflections/signature.d.ts +2 -2
- package/dist/lib/models/reflections/type-parameter.d.ts +1 -1
- package/dist/lib/models/reflections/utils.js +1 -2
- package/dist/lib/models/reflections/variant.d.ts +2 -0
- package/dist/lib/models/types.d.ts +4 -4
- package/dist/lib/models/types.js +3 -3
- package/dist/lib/output/events.d.ts +5 -5
- package/dist/lib/output/events.js +2 -1
- package/dist/lib/output/index.d.ts +1 -1
- package/dist/lib/output/index.js +2 -1
- package/dist/lib/output/plugins/AssetsPlugin.js +1 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +3 -1
- package/dist/lib/output/plugins/JavascriptIndexPlugin.js +28 -8
- package/dist/lib/output/plugins/SitemapPlugin.d.ts +1 -1
- package/dist/lib/output/plugins/SitemapPlugin.js +24 -13
- package/dist/lib/output/renderer.d.ts +1 -1
- package/dist/lib/output/renderer.js +5 -7
- package/dist/lib/output/themes/MarkedPlugin.d.ts +13 -24
- package/dist/lib/output/themes/MarkedPlugin.js +75 -160
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +16 -4
- package/dist/lib/output/themes/default/DefaultTheme.js +62 -16
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +44 -44
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +10 -10
- package/dist/lib/output/themes/default/layouts/default.js +1 -1
- package/dist/lib/output/themes/default/partials/analytics.js +1 -2
- package/dist/lib/output/themes/default/partials/anchor-icon.js +2 -3
- package/dist/lib/output/themes/default/partials/comment.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/comment.js +3 -4
- package/dist/lib/output/themes/default/partials/footer.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/footer.js +19 -5
- package/dist/lib/output/themes/default/partials/header.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/header.js +4 -3
- package/dist/lib/output/themes/default/partials/hierarchy.js +3 -4
- package/dist/lib/output/themes/default/partials/icon.js +7 -2
- package/dist/lib/output/themes/default/partials/index.js +4 -4
- package/dist/lib/output/themes/default/partials/member.d.ts +2 -2
- package/dist/lib/output/themes/default/partials/member.declaration.js +2 -3
- package/dist/lib/output/themes/default/partials/member.js +13 -2
- package/dist/lib/output/themes/default/partials/member.reference.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.reference.js +9 -6
- package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -4
- package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/member.signature.title.js +1 -2
- package/dist/lib/output/themes/default/partials/member.sources.js +12 -6
- package/dist/lib/output/themes/default/partials/members.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/members.group.js +1 -2
- package/dist/lib/output/themes/default/partials/members.js +1 -2
- package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/navigation.js +18 -15
- package/dist/lib/output/themes/default/partials/parameter.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/parameter.js +15 -15
- package/dist/lib/output/themes/default/partials/reflectionPreview.js +1 -2
- package/dist/lib/output/themes/default/partials/toolbar.js +4 -4
- package/dist/lib/output/themes/default/partials/type.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/type.js +14 -14
- package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +1 -1
- package/dist/lib/output/themes/default/partials/typeParameters.js +2 -3
- package/dist/lib/output/themes/default/templates/document.d.ts +5 -0
- package/dist/lib/output/themes/default/templates/document.js +7 -0
- package/dist/lib/output/themes/default/templates/hierarchy.js +1 -2
- package/dist/lib/output/themes/default/templates/reflection.d.ts +1 -1
- package/dist/lib/output/themes/default/templates/reflection.js +21 -19
- package/dist/lib/output/themes/lib.d.ts +1 -1
- package/dist/lib/output/themes/lib.js +12 -16
- package/dist/lib/serialization/deserializer.d.ts +3 -3
- package/dist/lib/serialization/deserializer.js +7 -5
- package/dist/lib/serialization/schema.d.ts +10 -3
- package/dist/lib/utils/array.js +9 -10
- package/dist/lib/utils/component.d.ts +1 -1
- package/dist/lib/utils/component.js +2 -2
- package/dist/lib/utils/entry-point.d.ts +11 -0
- package/dist/lib/utils/entry-point.js +51 -24
- package/dist/lib/utils/enum.js +6 -7
- package/dist/lib/utils/fs.js +15 -16
- package/dist/lib/utils/general.d.ts +4 -3
- package/dist/lib/utils/general.js +4 -5
- package/dist/lib/utils/highlighter.d.ts +4 -2
- package/dist/lib/utils/highlighter.js +41 -40
- package/dist/lib/utils/html.js +2 -3
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.js +1 -2
- package/dist/lib/utils/jsx.elements.d.ts +12 -0
- package/dist/lib/utils/jsx.js +4 -4
- package/dist/lib/utils/loggers.d.ts +13 -7
- package/dist/lib/utils/loggers.js +13 -10
- package/dist/lib/utils/map.d.ts +1 -1
- package/dist/lib/utils/map.js +1 -1
- package/dist/lib/utils/options/declaration.d.ts +40 -21
- package/dist/lib/utils/options/declaration.js +36 -36
- package/dist/lib/utils/options/help.d.ts +2 -1
- package/dist/lib/utils/options/help.js +10 -10
- package/dist/lib/utils/options/index.d.ts +1 -1
- package/dist/lib/utils/options/index.js +1 -2
- package/dist/lib/utils/options/options.d.ts +5 -34
- package/dist/lib/utils/options/options.js +10 -23
- package/dist/lib/utils/options/readers/arguments.js +3 -5
- package/dist/lib/utils/options/readers/package-json.js +2 -2
- package/dist/lib/utils/options/readers/tsconfig.js +8 -12
- package/dist/lib/utils/options/readers/typedoc.js +7 -6
- package/dist/lib/utils/options/sources/typedoc.js +187 -178
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
- package/dist/lib/utils/options/tsdoc-defaults.js +2 -0
- package/dist/lib/utils/package-manifest.d.ts +1 -1
- package/dist/lib/utils/package-manifest.js +9 -11
- package/dist/lib/utils/paths.js +4 -5
- package/dist/lib/utils/perf.js +3 -4
- package/dist/lib/utils/plugins.js +4 -5
- package/dist/lib/utils/reflections.d.ts +1 -1
- package/dist/lib/utils/reflections.js +2 -3
- package/dist/lib/utils/sort.d.ts +3 -2
- package/dist/lib/utils/sort.js +37 -6
- package/dist/lib/utils/tsconfig.js +3 -4
- package/dist/lib/utils/tsutils.js +2 -3
- package/dist/lib/utils/validation.js +4 -4
- package/dist/lib/validation/documentation.d.ts +1 -1
- package/dist/lib/validation/documentation.js +9 -4
- package/dist/lib/validation/exports.js +3 -5
- package/dist/lib/validation/links.js +2 -3
- package/package.json +12 -11
- package/static/main.js +4 -4
- package/static/style.css +18 -10
- package/tsdoc.json +9 -0
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
2
|
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
19
3
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
20
4
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
@@ -49,13 +33,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
49
33
|
}
|
|
50
34
|
return useValue ? value : void 0;
|
|
51
35
|
};
|
|
52
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
53
|
-
if (mod && mod.__esModule) return mod;
|
|
54
|
-
var result = {};
|
|
55
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
56
|
-
__setModuleDefault(result, mod);
|
|
57
|
-
return result;
|
|
58
|
-
};
|
|
59
36
|
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
60
37
|
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
61
38
|
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
@@ -71,33 +48,38 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
71
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");
|
|
72
49
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
73
50
|
};
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
74
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
55
|
exports.MarkedPlugin = void 0;
|
|
76
|
-
const
|
|
77
|
-
const Path = __importStar(require("path"));
|
|
78
|
-
const Marked = __importStar(require("marked"));
|
|
56
|
+
const markdown_it_1 = __importDefault(require("markdown-it"));
|
|
79
57
|
const components_1 = require("../components");
|
|
80
58
|
const events_1 = require("../events");
|
|
81
59
|
const utils_1 = require("../../utils");
|
|
82
60
|
const highlighter_1 = require("../../utils/highlighter");
|
|
83
61
|
const html_1 = require("../../utils/html");
|
|
62
|
+
const DefaultTheme_1 = require("./default/DefaultTheme");
|
|
63
|
+
const anchor_icon_1 = require("./default/partials/anchor-icon");
|
|
64
|
+
let defaultSlugger;
|
|
65
|
+
function getDefaultSlugger(logger) {
|
|
66
|
+
if (!defaultSlugger) {
|
|
67
|
+
logger.warn(logger.i18n.custom_theme_does_not_define_getSlugger());
|
|
68
|
+
defaultSlugger = new DefaultTheme_1.Slugger();
|
|
69
|
+
}
|
|
70
|
+
return defaultSlugger;
|
|
71
|
+
}
|
|
84
72
|
/**
|
|
85
73
|
* Implements markdown and relativeURL helpers for templates.
|
|
86
74
|
* @internal
|
|
87
75
|
*/
|
|
88
76
|
let MarkedPlugin = (() => {
|
|
89
|
-
var
|
|
77
|
+
var _MarkedPlugin_lightTheme_accessor_storage, _MarkedPlugin_darkTheme_accessor_storage;
|
|
90
78
|
let _classDecorators = [(0, components_1.Component)({ name: "marked" })];
|
|
91
79
|
let _classDescriptor;
|
|
92
80
|
let _classExtraInitializers = [];
|
|
93
81
|
let _classThis;
|
|
94
82
|
let _classSuper = components_1.ContextAwareRendererComponent;
|
|
95
|
-
let _includeSource_decorators;
|
|
96
|
-
let _includeSource_initializers = [];
|
|
97
|
-
let _includeSource_extraInitializers = [];
|
|
98
|
-
let _mediaSource_decorators;
|
|
99
|
-
let _mediaSource_initializers = [];
|
|
100
|
-
let _mediaSource_extraInitializers = [];
|
|
101
83
|
let _lightTheme_decorators;
|
|
102
84
|
let _lightTheme_initializers = [];
|
|
103
85
|
let _lightTheme_extraInitializers = [];
|
|
@@ -107,27 +89,16 @@ let MarkedPlugin = (() => {
|
|
|
107
89
|
var MarkedPlugin = _classThis = class extends _classSuper {
|
|
108
90
|
constructor() {
|
|
109
91
|
super(...arguments);
|
|
110
|
-
|
|
111
|
-
_MarkedPlugin_mediaSource_accessor_storage.set(this, (__runInitializers(this, _includeSource_extraInitializers), __runInitializers(this, _mediaSource_initializers, void 0)));
|
|
112
|
-
_MarkedPlugin_lightTheme_accessor_storage.set(this, (__runInitializers(this, _mediaSource_extraInitializers), __runInitializers(this, _lightTheme_initializers, void 0)));
|
|
92
|
+
_MarkedPlugin_lightTheme_accessor_storage.set(this, __runInitializers(this, _lightTheme_initializers, void 0));
|
|
113
93
|
_MarkedPlugin_darkTheme_accessor_storage.set(this, (__runInitializers(this, _lightTheme_extraInitializers), __runInitializers(this, _darkTheme_initializers, void 0)));
|
|
94
|
+
this.parser = __runInitializers(this, _darkTheme_extraInitializers);
|
|
114
95
|
/**
|
|
115
|
-
*
|
|
116
|
-
|
|
117
|
-
this.includes = __runInitializers(this, _darkTheme_extraInitializers);
|
|
118
|
-
/**
|
|
119
|
-
* The pattern used to find references in markdown.
|
|
120
|
-
*/
|
|
121
|
-
this.includePattern = /\[\[include:([^\]]+?)\]\]/g;
|
|
122
|
-
/**
|
|
123
|
-
* The pattern used to find media links.
|
|
96
|
+
* This needing to be here really feels hacky... probably some nicer way to do this.
|
|
97
|
+
* Revisit when adding support for arbitrary pages in 0.26.
|
|
124
98
|
*/
|
|
125
|
-
this.
|
|
99
|
+
this.renderContext = null;
|
|
100
|
+
this.lastHeaderSlug = "";
|
|
126
101
|
}
|
|
127
|
-
get includeSource() { return __classPrivateFieldGet(this, _MarkedPlugin_includeSource_accessor_storage, "f"); }
|
|
128
|
-
set includeSource(value) { __classPrivateFieldSet(this, _MarkedPlugin_includeSource_accessor_storage, value, "f"); }
|
|
129
|
-
get mediaSource() { return __classPrivateFieldGet(this, _MarkedPlugin_mediaSource_accessor_storage, "f"); }
|
|
130
|
-
set mediaSource(value) { __classPrivateFieldSet(this, _MarkedPlugin_mediaSource_accessor_storage, value, "f"); }
|
|
131
102
|
get lightTheme() { return __classPrivateFieldGet(this, _MarkedPlugin_lightTheme_accessor_storage, "f"); }
|
|
132
103
|
set lightTheme(value) { __classPrivateFieldSet(this, _MarkedPlugin_lightTheme_accessor_storage, value, "f"); }
|
|
133
104
|
get darkTheme() { return __classPrivateFieldGet(this, _MarkedPlugin_darkTheme_accessor_storage, "f"); }
|
|
@@ -150,14 +121,7 @@ let MarkedPlugin = (() => {
|
|
|
150
121
|
lang = lang || "typescript";
|
|
151
122
|
lang = lang.toLowerCase();
|
|
152
123
|
if (!(0, highlighter_1.isSupportedLanguage)(lang)) {
|
|
153
|
-
|
|
154
|
-
this.application.logger.warn(`
|
|
155
|
-
Unsupported highlight language "${lang}" will not be highlighted. Run typedoc --help for a list of supported languages.
|
|
156
|
-
target code block :
|
|
157
|
-
\t${text.split("\n").join("\n\t")}
|
|
158
|
-
source files :${this.sources?.map((source) => `\n\t${source.fileName}`).join()}
|
|
159
|
-
output file :
|
|
160
|
-
\t${this.outputFileName}`);
|
|
124
|
+
this.application.logger.warn(this.application.i18n.unsupported_highlight_language_0_not_highlighted_in_comment_for_1(lang, this.page?.model.getFriendlyFullName() ?? "(unknown)"));
|
|
161
125
|
return text;
|
|
162
126
|
}
|
|
163
127
|
return (0, highlighter_1.highlight)(text, lang);
|
|
@@ -168,36 +132,11 @@ output file :
|
|
|
168
132
|
* @param text The markdown string that should be parsed.
|
|
169
133
|
* @returns The resulting html string.
|
|
170
134
|
*/
|
|
171
|
-
parseMarkdown(text, page) {
|
|
172
|
-
|
|
173
|
-
text = text.replace(this.includePattern, (_match, path) => {
|
|
174
|
-
path = Path.join(this.includes, path.trim());
|
|
175
|
-
if ((0, utils_1.isFile)(path)) {
|
|
176
|
-
const contents = (0, utils_1.readFile)(path);
|
|
177
|
-
const event = new events_1.MarkdownEvent(events_1.MarkdownEvent.INCLUDE, page, contents, contents);
|
|
178
|
-
this.owner.trigger(event);
|
|
179
|
-
return event.parsedText;
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
this.application.logger.warn("Could not find file to include: " + path);
|
|
183
|
-
return "";
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
if (this.mediaDirectory) {
|
|
188
|
-
text = text.replace(this.mediaPattern, (match, path) => {
|
|
189
|
-
const fileName = Path.join(this.mediaDirectory, path);
|
|
190
|
-
if ((0, utils_1.isFile)(fileName)) {
|
|
191
|
-
return this.getRelativeUrl("media") + "/" + path;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
this.application.logger.warn("Could not find media file: " + fileName);
|
|
195
|
-
return match;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
135
|
+
parseMarkdown(text, page, context) {
|
|
136
|
+
this.renderContext = context;
|
|
199
137
|
const event = new events_1.MarkdownEvent(events_1.MarkdownEvent.PARSE, page, text, text);
|
|
200
138
|
this.owner.trigger(event);
|
|
139
|
+
this.renderContext = null;
|
|
201
140
|
return event.parsedText;
|
|
202
141
|
}
|
|
203
142
|
/**
|
|
@@ -207,63 +146,62 @@ output file :
|
|
|
207
146
|
*/
|
|
208
147
|
onBeginRenderer(event) {
|
|
209
148
|
super.onBeginRenderer(event);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
this.application.logger.warn("Could not find provided includes directory: " + this.includeSource);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (this.mediaSource) {
|
|
221
|
-
if (fs.existsSync(this.mediaSource) && fs.statSync(this.mediaSource).isDirectory()) {
|
|
222
|
-
this.mediaDirectory = Path.join(event.outputDirectory, "media");
|
|
223
|
-
(0, utils_1.copySync)(this.mediaSource, this.mediaDirectory);
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
this.mediaDirectory = undefined;
|
|
227
|
-
this.application.logger.warn("Could not find provided media directory: " + this.mediaSource);
|
|
228
|
-
}
|
|
149
|
+
this.setupParser();
|
|
150
|
+
}
|
|
151
|
+
getSlugger() {
|
|
152
|
+
if ("getSlugger" in this.owner.theme) {
|
|
153
|
+
return this.owner.theme.getSlugger(this.page.model);
|
|
229
154
|
}
|
|
155
|
+
return getDefaultSlugger(this.application.logger);
|
|
230
156
|
}
|
|
231
157
|
/**
|
|
232
158
|
* Creates an object with options that are passed to the markdown parser.
|
|
233
159
|
*
|
|
234
160
|
* @returns The options object for the markdown parser.
|
|
235
161
|
*/
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
162
|
+
setupParser() {
|
|
163
|
+
this.parser = (0, markdown_it_1.default)({
|
|
164
|
+
...this.application.options.getValue("markdownItOptions"),
|
|
165
|
+
html: true,
|
|
166
|
+
highlight: (code, lang) => {
|
|
167
|
+
code = (0, highlighter_1.highlight)(code, lang || "ts");
|
|
168
|
+
code = code.replace(/\n$/, "") + "\n";
|
|
169
|
+
if (!lang) {
|
|
170
|
+
return `<pre><code>${code}</code><button>Copy</button></pre>\n`;
|
|
171
|
+
}
|
|
172
|
+
return `<pre><code class="${(0, html_1.escapeHtml)(lang)}">${code}</code><button>Copy</button></pre>\n`;
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
const loader = this.application.options.getValue("markdownItLoader");
|
|
176
|
+
loader(this.parser);
|
|
177
|
+
// Add anchor links for headings in readme, and add them to the "On this page" section
|
|
178
|
+
this.parser.renderer.rules["heading_open"] = (tokens, idx) => {
|
|
179
|
+
const token = tokens[idx];
|
|
180
|
+
const content = tokens[idx + 1].content;
|
|
181
|
+
const level = token.markup.length;
|
|
182
|
+
const slug = this.getSlugger().slug(content);
|
|
183
|
+
this.lastHeaderSlug = slug;
|
|
184
|
+
// Prefix the slug with an extra `md:` to prevent conflicts with TypeDoc's anchors.
|
|
185
|
+
this.page.pageHeadings.push({
|
|
186
|
+
link: `#md:${slug}`,
|
|
187
|
+
text: (0, html_1.getTextContent)(content),
|
|
188
|
+
level,
|
|
189
|
+
});
|
|
190
|
+
return `<a id="md:${slug}" class="tsd-anchor"></a><${token.tag} class="tsd-anchor-link">`;
|
|
191
|
+
};
|
|
192
|
+
this.parser.renderer.rules["heading_close"] = (tokens, idx) => {
|
|
193
|
+
return `${(0, utils_1.renderElement)((0, anchor_icon_1.anchorIcon)(this.renderContext, `md:${this.lastHeaderSlug}`))}</${tokens[idx].tag}>`;
|
|
194
|
+
};
|
|
195
|
+
// Rewrite anchor links inline in a readme file to links targeting the `md:` prefixed anchors
|
|
196
|
+
// that TypeDoc creates.
|
|
197
|
+
this.parser.renderer.rules["link_open"] = (tokens, idx, options, _env, self) => {
|
|
198
|
+
const token = tokens[idx];
|
|
199
|
+
const href = token.attrGet("href")?.replace(/^#(?:md:)?(.+)/, "#md:$1");
|
|
200
|
+
if (href) {
|
|
201
|
+
token.attrSet("href", href);
|
|
202
|
+
}
|
|
203
|
+
return self.renderToken(tokens, idx, options);
|
|
204
|
+
};
|
|
267
205
|
}
|
|
268
206
|
/**
|
|
269
207
|
* Triggered when {@link MarkedPlugin} parses a markdown string.
|
|
@@ -271,22 +209,16 @@ output file :
|
|
|
271
209
|
* @param event
|
|
272
210
|
*/
|
|
273
211
|
onParseMarkdown(event) {
|
|
274
|
-
event.parsedText =
|
|
212
|
+
event.parsedText = this.parser.render(event.parsedText);
|
|
275
213
|
}
|
|
276
214
|
};
|
|
277
|
-
_MarkedPlugin_includeSource_accessor_storage = new WeakMap();
|
|
278
|
-
_MarkedPlugin_mediaSource_accessor_storage = new WeakMap();
|
|
279
215
|
_MarkedPlugin_lightTheme_accessor_storage = new WeakMap();
|
|
280
216
|
_MarkedPlugin_darkTheme_accessor_storage = new WeakMap();
|
|
281
217
|
__setFunctionName(_classThis, "MarkedPlugin");
|
|
282
218
|
(() => {
|
|
283
219
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
284
|
-
_includeSource_decorators = [(0, utils_1.Option)("includes")];
|
|
285
|
-
_mediaSource_decorators = [(0, utils_1.Option)("media")];
|
|
286
220
|
_lightTheme_decorators = [(0, utils_1.Option)("lightHighlightTheme")];
|
|
287
221
|
_darkTheme_decorators = [(0, utils_1.Option)("darkHighlightTheme")];
|
|
288
|
-
__esDecorate(_classThis, null, _includeSource_decorators, { kind: "accessor", name: "includeSource", static: false, private: false, access: { has: obj => "includeSource" in obj, get: obj => obj.includeSource, set: (obj, value) => { obj.includeSource = value; } }, metadata: _metadata }, _includeSource_initializers, _includeSource_extraInitializers);
|
|
289
|
-
__esDecorate(_classThis, null, _mediaSource_decorators, { kind: "accessor", name: "mediaSource", static: false, private: false, access: { has: obj => "mediaSource" in obj, get: obj => obj.mediaSource, set: (obj, value) => { obj.mediaSource = value; } }, metadata: _metadata }, _mediaSource_initializers, _mediaSource_extraInitializers);
|
|
290
222
|
__esDecorate(_classThis, null, _lightTheme_decorators, { kind: "accessor", name: "lightTheme", static: false, private: false, access: { has: obj => "lightTheme" in obj, get: obj => obj.lightTheme, set: (obj, value) => { obj.lightTheme = value; } }, metadata: _metadata }, _lightTheme_initializers, _lightTheme_extraInitializers);
|
|
291
223
|
__esDecorate(_classThis, null, _darkTheme_decorators, { kind: "accessor", name: "darkTheme", static: false, private: false, access: { has: obj => "darkTheme" in obj, get: obj => obj.darkTheme, set: (obj, value) => { obj.darkTheme = value; } }, metadata: _metadata }, _darkTheme_initializers, _darkTheme_extraInitializers);
|
|
292
224
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
@@ -297,20 +229,3 @@ output file :
|
|
|
297
229
|
return MarkedPlugin = _classThis;
|
|
298
230
|
})();
|
|
299
231
|
exports.MarkedPlugin = MarkedPlugin;
|
|
300
|
-
// Basically a copy/paste of Marked's code, with the addition of the button
|
|
301
|
-
// https://github.com/markedjs/marked/blob/v4.3.0/src/Renderer.js#L15-L39
|
|
302
|
-
function renderCode(code, infostring, escaped) {
|
|
303
|
-
const lang = (infostring || "").match(/\S*/)[0];
|
|
304
|
-
if (this.options.highlight) {
|
|
305
|
-
const out = this.options.highlight(code, lang);
|
|
306
|
-
if (out != null && out !== code) {
|
|
307
|
-
escaped = true;
|
|
308
|
-
code = out;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
code = code.replace(/\n$/, "") + "\n";
|
|
312
|
-
if (!lang) {
|
|
313
|
-
return `<pre><code>${escaped ? code : (0, html_1.escapeHtml)(code)}</code><button>Copy</button></pre>\n`;
|
|
314
|
-
}
|
|
315
|
-
return `<pre><code class="${this.options.langPrefix + (0, html_1.escapeHtml)(lang)}">${escaped ? code : (0, html_1.escapeHtml)(code)}</code><button>Copy</button></pre>\n`;
|
|
316
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Theme } from "../../theme";
|
|
2
2
|
import type { Renderer } from "../../renderer";
|
|
3
|
-
import { Reflection, ReflectionKind, ProjectReflection, ContainerReflection, DeclarationReflection } from "../../../models";
|
|
4
|
-
import { RenderTemplate, UrlMapping } from "../../models/UrlMapping";
|
|
3
|
+
import { type Reflection, ReflectionKind, ProjectReflection, type ContainerReflection, DeclarationReflection, type DocumentReflection } from "../../../models";
|
|
4
|
+
import { type RenderTemplate, UrlMapping } from "../../models/UrlMapping";
|
|
5
5
|
import type { PageEvent } from "../../events";
|
|
6
6
|
import type { MarkedPlugin } from "../../plugins";
|
|
7
7
|
import { DefaultThemeRenderContext } from "./DefaultThemeRenderContext";
|
|
@@ -13,6 +13,14 @@ export interface NavigationElement {
|
|
|
13
13
|
class?: string;
|
|
14
14
|
children?: NavigationElement[];
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Responsible for getting a unique anchor for elements within a page.
|
|
18
|
+
*/
|
|
19
|
+
export declare class Slugger {
|
|
20
|
+
private seen;
|
|
21
|
+
private serialize;
|
|
22
|
+
slug(value: string): string;
|
|
23
|
+
}
|
|
16
24
|
/**
|
|
17
25
|
* Default theme implementation of TypeDoc. If a theme does not provide a custom
|
|
18
26
|
* {@link Theme} implementation, this theme class will be used.
|
|
@@ -59,17 +67,19 @@ export declare class DefaultTheme extends Theme {
|
|
|
59
67
|
1048576: () => JSX.Element;
|
|
60
68
|
2097152: () => JSX.Element;
|
|
61
69
|
4194304: () => JSX.Element;
|
|
70
|
+
8388608: () => JSX.Element;
|
|
62
71
|
checkbox: () => JSX.Element;
|
|
63
72
|
chevronDown: () => JSX.Element;
|
|
64
73
|
menu: () => JSX.Element;
|
|
65
74
|
chevronSmall: () => JSX.Element;
|
|
66
75
|
};
|
|
67
76
|
getRenderContext(pageEvent: PageEvent<Reflection>): DefaultThemeRenderContext;
|
|
77
|
+
documentTemplate: (pageEvent: PageEvent<DocumentReflection>) => JSX.Element;
|
|
68
78
|
reflectionTemplate: (pageEvent: PageEvent<ContainerReflection>) => JSX.Element;
|
|
69
79
|
indexTemplate: (pageEvent: PageEvent<ProjectReflection>) => JSX.Element;
|
|
70
80
|
hierarchyTemplate: (pageEvent: PageEvent<ProjectReflection>) => JSX.Element;
|
|
71
81
|
defaultLayoutTemplate: (pageEvent: PageEvent<Reflection>, template: RenderTemplate<PageEvent<Reflection>>) => JSX.Element;
|
|
72
|
-
getReflectionClasses(reflection: DeclarationReflection): string;
|
|
82
|
+
getReflectionClasses(reflection: DeclarationReflection | DocumentReflection): string;
|
|
73
83
|
/**
|
|
74
84
|
* Mappings of reflections kinds to templates used by this theme.
|
|
75
85
|
*/
|
|
@@ -112,7 +122,7 @@ export declare class DefaultTheme extends Theme {
|
|
|
112
122
|
* @param urls The array the url should be appended to.
|
|
113
123
|
* @returns The altered urls array.
|
|
114
124
|
*/
|
|
115
|
-
buildUrls(reflection: DeclarationReflection, urls: UrlMapping[]): UrlMapping[];
|
|
125
|
+
buildUrls(reflection: DeclarationReflection | DocumentReflection, urls: UrlMapping[]): UrlMapping[];
|
|
116
126
|
render(page: PageEvent<Reflection>, template: RenderTemplate<PageEvent<Reflection>>): string;
|
|
117
127
|
private _navigationCache;
|
|
118
128
|
/**
|
|
@@ -120,6 +130,8 @@ export declare class DefaultTheme extends Theme {
|
|
|
120
130
|
*/
|
|
121
131
|
getNavigation(project: ProjectReflection): NavigationElement[];
|
|
122
132
|
buildNavigation(project: ProjectReflection): NavigationElement[];
|
|
133
|
+
private sluggers;
|
|
134
|
+
getSlugger(reflection: Reflection): Slugger;
|
|
123
135
|
/**
|
|
124
136
|
* Generate an anchor url for the given reflection and all of its children.
|
|
125
137
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultTheme = void 0;
|
|
3
|
+
exports.DefaultTheme = exports.Slugger = void 0;
|
|
4
4
|
const theme_1 = require("../../theme");
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
6
|
const UrlMapping_1 = require("../../models/UrlMapping");
|
|
@@ -8,6 +8,41 @@ const DefaultThemeRenderContext_1 = require("./DefaultThemeRenderContext");
|
|
|
8
8
|
const utils_1 = require("../../../utils");
|
|
9
9
|
const lib_1 = require("../lib");
|
|
10
10
|
const icon_1 = require("./partials/icon");
|
|
11
|
+
/**
|
|
12
|
+
* Responsible for getting a unique anchor for elements within a page.
|
|
13
|
+
*/
|
|
14
|
+
class Slugger {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.seen = new Map();
|
|
17
|
+
}
|
|
18
|
+
serialize(value) {
|
|
19
|
+
// Extracted from marked@4.3.0
|
|
20
|
+
return (value
|
|
21
|
+
.toLowerCase()
|
|
22
|
+
.trim()
|
|
23
|
+
// remove html tags
|
|
24
|
+
.replace(/<[!/a-z].*?>/gi, "")
|
|
25
|
+
// remove unwanted chars
|
|
26
|
+
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "")
|
|
27
|
+
.replace(/\s/g, "-"));
|
|
28
|
+
}
|
|
29
|
+
slug(value) {
|
|
30
|
+
const originalSlug = this.serialize(value);
|
|
31
|
+
let slug = originalSlug;
|
|
32
|
+
let count = 0;
|
|
33
|
+
if (this.seen.has(slug)) {
|
|
34
|
+
count = this.seen.get(originalSlug);
|
|
35
|
+
do {
|
|
36
|
+
count++;
|
|
37
|
+
slug = originalSlug + "-" + count;
|
|
38
|
+
} while (this.seen.has(slug));
|
|
39
|
+
}
|
|
40
|
+
this.seen.set(originalSlug, count);
|
|
41
|
+
this.seen.set(slug, 0);
|
|
42
|
+
return slug;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Slugger = Slugger;
|
|
11
46
|
/**
|
|
12
47
|
* Default theme implementation of TypeDoc. If a theme does not provide a custom
|
|
13
48
|
* {@link Theme} implementation, this theme class will be used.
|
|
@@ -41,6 +76,9 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
41
76
|
* elements, so custom themes must also use svg elements.
|
|
42
77
|
*/
|
|
43
78
|
this.icons = { ...icon_1.icons };
|
|
79
|
+
this.documentTemplate = (pageEvent) => {
|
|
80
|
+
return this.getRenderContext(pageEvent).documentTemplate(pageEvent);
|
|
81
|
+
};
|
|
44
82
|
this.reflectionTemplate = (pageEvent) => {
|
|
45
83
|
return this.getRenderContext(pageEvent).reflectionTemplate(pageEvent);
|
|
46
84
|
};
|
|
@@ -92,7 +130,13 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
92
130
|
directory: "variables",
|
|
93
131
|
template: this.reflectionTemplate,
|
|
94
132
|
},
|
|
133
|
+
{
|
|
134
|
+
kind: [models_1.ReflectionKind.Document],
|
|
135
|
+
directory: "variables",
|
|
136
|
+
template: this.documentTemplate,
|
|
137
|
+
},
|
|
95
138
|
];
|
|
139
|
+
this.sluggers = new Map();
|
|
96
140
|
this.markedPlugin = renderer.getComponent("marked");
|
|
97
141
|
}
|
|
98
142
|
/**
|
|
@@ -104,6 +148,7 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
104
148
|
*/
|
|
105
149
|
getUrls(project) {
|
|
106
150
|
const urls = [];
|
|
151
|
+
this.sluggers.set(project, new Slugger());
|
|
107
152
|
if (false == hasReadme(this.application.options.getValue("readme"))) {
|
|
108
153
|
project.url = "index.html";
|
|
109
154
|
urls.push(new UrlMapping_1.UrlMapping("index.html", project, this.reflectionTemplate));
|
|
@@ -122,11 +167,7 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
122
167
|
if ((0, lib_1.getHierarchyRoots)(project).length) {
|
|
123
168
|
urls.push(new UrlMapping_1.UrlMapping("hierarchy.html", project, this.hierarchyTemplate));
|
|
124
169
|
}
|
|
125
|
-
project.
|
|
126
|
-
if (child instanceof models_1.DeclarationReflection) {
|
|
127
|
-
this.buildUrls(child, urls);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
170
|
+
project.childrenIncludingDocuments?.forEach((child) => this.buildUrls(child, urls));
|
|
130
171
|
return urls;
|
|
131
172
|
}
|
|
132
173
|
/**
|
|
@@ -166,11 +207,12 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
166
207
|
if (!reflection.url || !DefaultTheme.URL_PREFIX.test(reflection.url)) {
|
|
167
208
|
const url = [mapping.directory, DefaultTheme.getUrl(reflection) + ".html"].join("/");
|
|
168
209
|
urls.push(new UrlMapping_1.UrlMapping(url, reflection, mapping.template));
|
|
210
|
+
this.sluggers.set(reflection, new Slugger());
|
|
169
211
|
reflection.url = url;
|
|
170
212
|
reflection.hasOwnDocument = true;
|
|
171
213
|
}
|
|
172
214
|
reflection.traverse((child) => {
|
|
173
|
-
if (child
|
|
215
|
+
if (child.isDeclaration() || child.isDocument()) {
|
|
174
216
|
this.buildUrls(child, urls);
|
|
175
217
|
}
|
|
176
218
|
else {
|
|
@@ -204,9 +246,6 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
204
246
|
const theme = this;
|
|
205
247
|
const opts = this.application.options.getValue("navigation");
|
|
206
248
|
const leaves = this.application.options.getValue("navigationLeaves");
|
|
207
|
-
if (opts.fullTree) {
|
|
208
|
-
this.application.logger.warn(`The navigation.fullTree option no longer has any affect and will be removed in v0.26`);
|
|
209
|
-
}
|
|
210
249
|
return getNavigationElements(project) || [];
|
|
211
250
|
function toNavigation(element) {
|
|
212
251
|
if (element instanceof models_1.ReflectionCategory || element instanceof models_1.ReflectionGroup) {
|
|
@@ -236,7 +275,7 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
236
275
|
if (leaves.includes(parent.getFullName())) {
|
|
237
276
|
return;
|
|
238
277
|
}
|
|
239
|
-
if (!parent.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project)) {
|
|
278
|
+
if (!parent.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project) || parent.isDocument()) {
|
|
240
279
|
return;
|
|
241
280
|
}
|
|
242
281
|
if (parent.categories && shouldShowCategories(parent, opts)) {
|
|
@@ -246,11 +285,11 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
246
285
|
return parent.groups.map(toNavigation);
|
|
247
286
|
}
|
|
248
287
|
if (opts.includeFolders &&
|
|
249
|
-
parent.
|
|
250
|
-
parent.
|
|
251
|
-
return deriveModuleFolders(parent.
|
|
288
|
+
parent.childrenIncludingDocuments?.every((child) => child.kindOf(models_1.ReflectionKind.Module | models_1.ReflectionKind.Document)) &&
|
|
289
|
+
parent.childrenIncludingDocuments.some((child) => child.name.includes("/"))) {
|
|
290
|
+
return deriveModuleFolders(parent.childrenIncludingDocuments);
|
|
252
291
|
}
|
|
253
|
-
return parent.
|
|
292
|
+
return parent.childrenIncludingDocuments?.map(toNavigation);
|
|
254
293
|
}
|
|
255
294
|
function deriveModuleFolders(children) {
|
|
256
295
|
const result = [];
|
|
@@ -300,6 +339,13 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
300
339
|
return result;
|
|
301
340
|
}
|
|
302
341
|
}
|
|
342
|
+
getSlugger(reflection) {
|
|
343
|
+
if (this.sluggers.has(reflection)) {
|
|
344
|
+
return this.sluggers.get(reflection);
|
|
345
|
+
}
|
|
346
|
+
// A slugger should always be defined at least for the project
|
|
347
|
+
return this.getSlugger(reflection.parent);
|
|
348
|
+
}
|
|
303
349
|
/**
|
|
304
350
|
* Generate an anchor url for the given reflection and all of its children.
|
|
305
351
|
*
|
|
@@ -335,7 +381,7 @@ function getReflectionClasses(reflection, filters) {
|
|
|
335
381
|
// partials/navigation.tsx.
|
|
336
382
|
for (const key of Object.keys(filters)) {
|
|
337
383
|
if (key === "inherited") {
|
|
338
|
-
if (reflection.inheritedFrom) {
|
|
384
|
+
if (reflection.isDeclaration() && reflection.inheritedFrom) {
|
|
339
385
|
classes.push("tsd-is-inherited");
|
|
340
386
|
}
|
|
341
387
|
}
|