typedoc 0.25.13 → 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/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/lib/application.d.ts +15 -3
- package/dist/lib/application.js +75 -24
- 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 +147 -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 +10 -2
- package/dist/lib/converter/convert-expression.js +2 -3
- package/dist/lib/converter/converter.d.ts +9 -4
- package/dist/lib/converter/converter.js +55 -17
- 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 +14 -15
- 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 +24 -17
- package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -1
- package/dist/lib/converter/plugins/CommentPlugin.js +112 -69
- 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 +6 -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 +304 -0
- package/dist/lib/internationalization/translatable.js +329 -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 +14 -1
- package/dist/lib/models/reflections/kind.js +13 -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 +17 -27
- package/dist/lib/output/renderer.d.ts +3 -1
- package/dist/lib/output/renderer.js +7 -7
- package/dist/lib/output/themes/MarkedPlugin.d.ts +16 -25
- package/dist/lib/output/themes/MarkedPlugin.js +89 -161
- package/dist/lib/output/themes/default/DefaultTheme.d.ts +16 -4
- package/dist/lib/output/themes/default/DefaultTheme.js +66 -17
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +44 -44
- package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +6 -13
- package/dist/lib/output/themes/default/layouts/default.js +2 -2
- 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.js +31 -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 +19 -17
- 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 +13 -1
- 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 +48 -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 +13 -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.d.ts +1 -1
- package/dist/lib/utils/options/readers/typedoc.js +8 -7
- package/dist/lib/utils/options/sources/typedoc.js +225 -178
- package/dist/lib/utils/options/tsdoc-defaults.d.ts +4 -4
- package/dist/lib/utils/options/tsdoc-defaults.js +27 -20
- 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/set.d.ts +1 -0
- package/dist/lib/utils/set.js +12 -0
- 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 +46 -29
- package/tsdoc.json +22 -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,67 +48,68 @@ 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
|
+
const models_1 = require("../../models");
|
|
65
|
+
let defaultSlugger;
|
|
66
|
+
function getDefaultSlugger(logger) {
|
|
67
|
+
if (!defaultSlugger) {
|
|
68
|
+
logger.warn(logger.i18n.custom_theme_does_not_define_getSlugger());
|
|
69
|
+
defaultSlugger = new DefaultTheme_1.Slugger();
|
|
70
|
+
}
|
|
71
|
+
return defaultSlugger;
|
|
72
|
+
}
|
|
84
73
|
/**
|
|
85
74
|
* Implements markdown and relativeURL helpers for templates.
|
|
86
75
|
* @internal
|
|
87
76
|
*/
|
|
88
77
|
let MarkedPlugin = (() => {
|
|
89
|
-
var
|
|
78
|
+
var _MarkedPlugin_lightTheme_accessor_storage, _MarkedPlugin_darkTheme_accessor_storage, _MarkedPlugin_markdownItOptions_accessor_storage;
|
|
90
79
|
let _classDecorators = [(0, components_1.Component)({ name: "marked" })];
|
|
91
80
|
let _classDescriptor;
|
|
92
81
|
let _classExtraInitializers = [];
|
|
93
82
|
let _classThis;
|
|
94
83
|
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
84
|
let _lightTheme_decorators;
|
|
102
85
|
let _lightTheme_initializers = [];
|
|
103
86
|
let _lightTheme_extraInitializers = [];
|
|
104
87
|
let _darkTheme_decorators;
|
|
105
88
|
let _darkTheme_initializers = [];
|
|
106
89
|
let _darkTheme_extraInitializers = [];
|
|
90
|
+
let _markdownItOptions_decorators;
|
|
91
|
+
let _markdownItOptions_initializers = [];
|
|
92
|
+
let _markdownItOptions_extraInitializers = [];
|
|
107
93
|
var MarkedPlugin = _classThis = class extends _classSuper {
|
|
108
94
|
constructor() {
|
|
109
95
|
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)));
|
|
96
|
+
_MarkedPlugin_lightTheme_accessor_storage.set(this, __runInitializers(this, _lightTheme_initializers, void 0));
|
|
113
97
|
_MarkedPlugin_darkTheme_accessor_storage.set(this, (__runInitializers(this, _lightTheme_extraInitializers), __runInitializers(this, _darkTheme_initializers, void 0)));
|
|
98
|
+
_MarkedPlugin_markdownItOptions_accessor_storage.set(this, (__runInitializers(this, _darkTheme_extraInitializers), __runInitializers(this, _markdownItOptions_initializers, void 0)));
|
|
99
|
+
this.parser = __runInitializers(this, _markdownItOptions_extraInitializers);
|
|
114
100
|
/**
|
|
115
|
-
*
|
|
116
|
-
|
|
117
|
-
this.includes = __runInitializers(this, _darkTheme_extraInitializers);
|
|
118
|
-
/**
|
|
119
|
-
* The pattern used to find references in markdown.
|
|
101
|
+
* This needing to be here really feels hacky... probably some nicer way to do this.
|
|
102
|
+
* Revisit when adding support for arbitrary pages in 0.26.
|
|
120
103
|
*/
|
|
121
|
-
this.
|
|
122
|
-
|
|
123
|
-
* The pattern used to find media links.
|
|
124
|
-
*/
|
|
125
|
-
this.mediaPattern = /media:\/\/([^ ")\]}]+)/g;
|
|
104
|
+
this.renderContext = null;
|
|
105
|
+
this.lastHeaderSlug = "";
|
|
126
106
|
}
|
|
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
107
|
get lightTheme() { return __classPrivateFieldGet(this, _MarkedPlugin_lightTheme_accessor_storage, "f"); }
|
|
132
108
|
set lightTheme(value) { __classPrivateFieldSet(this, _MarkedPlugin_lightTheme_accessor_storage, value, "f"); }
|
|
133
109
|
get darkTheme() { return __classPrivateFieldGet(this, _MarkedPlugin_darkTheme_accessor_storage, "f"); }
|
|
134
110
|
set darkTheme(value) { __classPrivateFieldSet(this, _MarkedPlugin_darkTheme_accessor_storage, value, "f"); }
|
|
111
|
+
get markdownItOptions() { return __classPrivateFieldGet(this, _MarkedPlugin_markdownItOptions_accessor_storage, "f"); }
|
|
112
|
+
set markdownItOptions(value) { __classPrivateFieldSet(this, _MarkedPlugin_markdownItOptions_accessor_storage, value, "f"); }
|
|
135
113
|
/**
|
|
136
114
|
* Create a new MarkedPlugin instance.
|
|
137
115
|
*/
|
|
@@ -150,14 +128,7 @@ let MarkedPlugin = (() => {
|
|
|
150
128
|
lang = lang || "typescript";
|
|
151
129
|
lang = lang.toLowerCase();
|
|
152
130
|
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}`);
|
|
131
|
+
this.application.logger.warn(this.application.i18n.unsupported_highlight_language_0_not_highlighted_in_comment_for_1(lang, this.page?.model.getFriendlyFullName() ?? "(unknown)"));
|
|
161
132
|
return text;
|
|
162
133
|
}
|
|
163
134
|
return (0, highlighter_1.highlight)(text, lang);
|
|
@@ -165,39 +136,18 @@ output file :
|
|
|
165
136
|
/**
|
|
166
137
|
* Parse the given markdown string and return the resulting html.
|
|
167
138
|
*
|
|
168
|
-
* @param
|
|
139
|
+
* @param input The markdown string that should be parsed.
|
|
169
140
|
* @returns The resulting html string.
|
|
170
141
|
*/
|
|
171
|
-
parseMarkdown(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
});
|
|
142
|
+
parseMarkdown(input, page, context) {
|
|
143
|
+
let markdown = input;
|
|
144
|
+
if (typeof markdown !== "string") {
|
|
145
|
+
markdown = models_1.Comment.displayPartsToMarkdown(markdown, context.urlTo, !!this.markdownItOptions["html"]);
|
|
198
146
|
}
|
|
199
|
-
|
|
147
|
+
this.renderContext = context;
|
|
148
|
+
const event = new events_1.MarkdownEvent(events_1.MarkdownEvent.PARSE, page, markdown, markdown);
|
|
200
149
|
this.owner.trigger(event);
|
|
150
|
+
this.renderContext = null;
|
|
201
151
|
return event.parsedText;
|
|
202
152
|
}
|
|
203
153
|
/**
|
|
@@ -207,63 +157,61 @@ output file :
|
|
|
207
157
|
*/
|
|
208
158
|
onBeginRenderer(event) {
|
|
209
159
|
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
|
-
}
|
|
160
|
+
this.setupParser();
|
|
161
|
+
}
|
|
162
|
+
getSlugger() {
|
|
163
|
+
if ("getSlugger" in this.owner.theme) {
|
|
164
|
+
return this.owner.theme.getSlugger(this.page.model);
|
|
229
165
|
}
|
|
166
|
+
return getDefaultSlugger(this.application.logger);
|
|
230
167
|
}
|
|
231
168
|
/**
|
|
232
169
|
* Creates an object with options that are passed to the markdown parser.
|
|
233
170
|
*
|
|
234
171
|
* @returns The options object for the markdown parser.
|
|
235
172
|
*/
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
return (0,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
|
|
173
|
+
setupParser() {
|
|
174
|
+
this.parser = (0, markdown_it_1.default)({
|
|
175
|
+
...this.markdownItOptions,
|
|
176
|
+
highlight: (code, lang) => {
|
|
177
|
+
code = (0, highlighter_1.highlight)(code, lang || "ts");
|
|
178
|
+
code = code.replace(/\n$/, "") + "\n";
|
|
179
|
+
if (!lang) {
|
|
180
|
+
return `<pre><code>${code}</code><button>Copy</button></pre>\n`;
|
|
181
|
+
}
|
|
182
|
+
return `<pre><code class="${(0, html_1.escapeHtml)(lang)}">${code}</code><button type="button">Copy</button></pre>\n`;
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
const loader = this.application.options.getValue("markdownItLoader");
|
|
186
|
+
loader(this.parser);
|
|
187
|
+
// Add anchor links for headings in readme, and add them to the "On this page" section
|
|
188
|
+
this.parser.renderer.rules["heading_open"] = (tokens, idx) => {
|
|
189
|
+
const token = tokens[idx];
|
|
190
|
+
const content = tokens[idx + 1].content;
|
|
191
|
+
const level = token.markup.length;
|
|
192
|
+
const slug = this.getSlugger().slug(content);
|
|
193
|
+
this.lastHeaderSlug = slug;
|
|
194
|
+
// Prefix the slug with an extra `md:` to prevent conflicts with TypeDoc's anchors.
|
|
195
|
+
this.page.pageHeadings.push({
|
|
196
|
+
link: `#md:${slug}`,
|
|
197
|
+
text: (0, html_1.getTextContent)(content),
|
|
198
|
+
level,
|
|
199
|
+
});
|
|
200
|
+
return `<a id="md:${slug}" class="tsd-anchor"></a><${token.tag} class="tsd-anchor-link">`;
|
|
201
|
+
};
|
|
202
|
+
this.parser.renderer.rules["heading_close"] = (tokens, idx) => {
|
|
203
|
+
return `${(0, utils_1.renderElement)((0, anchor_icon_1.anchorIcon)(this.renderContext, `md:${this.lastHeaderSlug}`))}</${tokens[idx].tag}>`;
|
|
204
|
+
};
|
|
205
|
+
// Rewrite anchor links inline in a readme file to links targeting the `md:` prefixed anchors
|
|
206
|
+
// that TypeDoc creates.
|
|
207
|
+
this.parser.renderer.rules["link_open"] = (tokens, idx, options, _env, self) => {
|
|
208
|
+
const token = tokens[idx];
|
|
209
|
+
const href = token.attrGet("href")?.replace(/^#(?:md:)?(.+)/, "#md:$1");
|
|
210
|
+
if (href) {
|
|
211
|
+
token.attrSet("href", href);
|
|
212
|
+
}
|
|
213
|
+
return self.renderToken(tokens, idx, options);
|
|
214
|
+
};
|
|
267
215
|
}
|
|
268
216
|
/**
|
|
269
217
|
* Triggered when {@link MarkedPlugin} parses a markdown string.
|
|
@@ -271,24 +219,21 @@ output file :
|
|
|
271
219
|
* @param event
|
|
272
220
|
*/
|
|
273
221
|
onParseMarkdown(event) {
|
|
274
|
-
event.parsedText =
|
|
222
|
+
event.parsedText = this.parser.render(event.parsedText);
|
|
275
223
|
}
|
|
276
224
|
};
|
|
277
|
-
_MarkedPlugin_includeSource_accessor_storage = new WeakMap();
|
|
278
|
-
_MarkedPlugin_mediaSource_accessor_storage = new WeakMap();
|
|
279
225
|
_MarkedPlugin_lightTheme_accessor_storage = new WeakMap();
|
|
280
226
|
_MarkedPlugin_darkTheme_accessor_storage = new WeakMap();
|
|
227
|
+
_MarkedPlugin_markdownItOptions_accessor_storage = new WeakMap();
|
|
281
228
|
__setFunctionName(_classThis, "MarkedPlugin");
|
|
282
229
|
(() => {
|
|
283
230
|
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
231
|
_lightTheme_decorators = [(0, utils_1.Option)("lightHighlightTheme")];
|
|
287
232
|
_darkTheme_decorators = [(0, utils_1.Option)("darkHighlightTheme")];
|
|
288
|
-
|
|
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);
|
|
233
|
+
_markdownItOptions_decorators = [(0, utils_1.Option)("markdownItOptions")];
|
|
290
234
|
__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
235
|
__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);
|
|
236
|
+
__esDecorate(_classThis, null, _markdownItOptions_decorators, { kind: "accessor", name: "markdownItOptions", static: false, private: false, access: { has: obj => "markdownItOptions" in obj, get: obj => obj.markdownItOptions, set: (obj, value) => { obj.markdownItOptions = value; } }, metadata: _metadata }, _markdownItOptions_initializers, _markdownItOptions_extraInitializers);
|
|
292
237
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
293
238
|
MarkedPlugin = _classThis = _classDescriptor.value;
|
|
294
239
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
@@ -297,20 +242,3 @@ output file :
|
|
|
297
242
|
return MarkedPlugin = _classThis;
|
|
298
243
|
})();
|
|
299
244
|
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 {
|
|
4
|
-
import { RenderTemplate, UrlMapping } from "../../models/UrlMapping";
|
|
3
|
+
import { ReflectionKind, ProjectReflection, type ContainerReflection, DeclarationReflection, type Reflection, 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: "documents",
|
|
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,21 +275,24 @@ 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.
|
|
278
|
+
if (!parent.kindOf(models_1.ReflectionKind.MayContainDocuments) || parent.isDocument()) {
|
|
240
279
|
return;
|
|
241
280
|
}
|
|
281
|
+
if (!parent.kindOf(models_1.ReflectionKind.SomeModule | models_1.ReflectionKind.Project)) {
|
|
282
|
+
// Tricky: Non-module children don't show up in the navigation pane,
|
|
283
|
+
// but any documents added by them should.
|
|
284
|
+
return parent.documents?.map(toNavigation);
|
|
285
|
+
}
|
|
242
286
|
if (parent.categories && shouldShowCategories(parent, opts)) {
|
|
243
287
|
return parent.categories.map(toNavigation);
|
|
244
288
|
}
|
|
245
289
|
if (parent.groups && shouldShowGroups(parent, opts)) {
|
|
246
290
|
return parent.groups.map(toNavigation);
|
|
247
291
|
}
|
|
248
|
-
if (opts.includeFolders &&
|
|
249
|
-
|
|
250
|
-
parent.children.some((child) => child.name.includes("/"))) {
|
|
251
|
-
return deriveModuleFolders(parent.children);
|
|
292
|
+
if (opts.includeFolders && parent.childrenIncludingDocuments?.some((child) => child.name.includes("/"))) {
|
|
293
|
+
return deriveModuleFolders(parent.childrenIncludingDocuments);
|
|
252
294
|
}
|
|
253
|
-
return parent.
|
|
295
|
+
return parent.childrenIncludingDocuments?.map(toNavigation);
|
|
254
296
|
}
|
|
255
297
|
function deriveModuleFolders(children) {
|
|
256
298
|
const result = [];
|
|
@@ -300,6 +342,13 @@ class DefaultTheme extends theme_1.Theme {
|
|
|
300
342
|
return result;
|
|
301
343
|
}
|
|
302
344
|
}
|
|
345
|
+
getSlugger(reflection) {
|
|
346
|
+
if (this.sluggers.has(reflection)) {
|
|
347
|
+
return this.sluggers.get(reflection);
|
|
348
|
+
}
|
|
349
|
+
// A slugger should always be defined at least for the project
|
|
350
|
+
return this.getSlugger(reflection.parent);
|
|
351
|
+
}
|
|
303
352
|
/**
|
|
304
353
|
* Generate an anchor url for the given reflection and all of its children.
|
|
305
354
|
*
|
|
@@ -335,7 +384,7 @@ function getReflectionClasses(reflection, filters) {
|
|
|
335
384
|
// partials/navigation.tsx.
|
|
336
385
|
for (const key of Object.keys(filters)) {
|
|
337
386
|
if (key === "inherited") {
|
|
338
|
-
if (reflection.inheritedFrom) {
|
|
387
|
+
if (reflection.isDeclaration() && reflection.inheritedFrom) {
|
|
339
388
|
classes.push("tsd-is-inherited");
|
|
340
389
|
}
|
|
341
390
|
}
|