docusaurus-plugin-typedoc 0.17.4 → 0.17.5
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/options.js +1 -0
- package/dist/theme.d.ts +0 -1
- package/dist/theme.js +22 -27
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
package/dist/options.js
CHANGED
package/dist/theme.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export declare class DocusaurusTheme extends MarkdownTheme {
|
|
|
16
16
|
getSidebarPosition(page: PageEvent<DeclarationReflection>): "0.5" | "0" | null;
|
|
17
17
|
getId(page: PageEvent): string;
|
|
18
18
|
getTitle(page: PageEvent): any;
|
|
19
|
-
getSlug(): string;
|
|
20
19
|
get mappings(): {
|
|
21
20
|
kind: ReflectionKind[];
|
|
22
21
|
isLeaf: boolean;
|
package/dist/theme.js
CHANGED
|
@@ -30,11 +30,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.DocusaurusTheme = void 0;
|
|
33
|
-
const typedoc_1 = require("typedoc");
|
|
34
33
|
const fs = __importStar(require("fs"));
|
|
35
|
-
const theme_1 = require("typedoc-plugin-markdown/dist/theme");
|
|
36
|
-
const groups_1 = require("typedoc-plugin-markdown/dist/groups");
|
|
37
34
|
const path = __importStar(require("path"));
|
|
35
|
+
const typedoc_1 = require("typedoc");
|
|
36
|
+
const groups_1 = require("typedoc-plugin-markdown/dist/groups");
|
|
37
|
+
const theme_1 = require("typedoc-plugin-markdown/dist/theme");
|
|
38
38
|
const front_matter_1 = require("typedoc-plugin-markdown/dist/utils/front-matter");
|
|
39
39
|
const CATEGORY_POSITION = {
|
|
40
40
|
[typedoc_1.ReflectionKind.Module]: 1,
|
|
@@ -69,14 +69,16 @@ class DocusaurusTheme extends theme_1.MarkdownTheme {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
onRendererEnd(renderer) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
if (this.sidebar.autoConfiguration) {
|
|
73
|
+
writeCategoryYaml(renderer.outputDirectory, this.sidebar.categoryLabel, this.sidebar.position);
|
|
74
|
+
Object.keys(groupUrlsByKind(this.getUrls(renderer.project))).forEach((group) => {
|
|
75
|
+
const kind = parseInt(group);
|
|
76
|
+
const mapping = this.mappings.find((mapping) => mapping.kind.includes(kind));
|
|
77
|
+
if (mapping) {
|
|
78
|
+
writeCategoryYaml(renderer.outputDirectory + '/' + mapping.directory, (0, groups_1.getKindPlural)(kind), CATEGORY_POSITION[kind]);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
80
82
|
}
|
|
81
83
|
getYamlItems(page) {
|
|
82
84
|
const pageId = this.getId(page);
|
|
@@ -87,14 +89,16 @@ class DocusaurusTheme extends theme_1.MarkdownTheme {
|
|
|
87
89
|
id: pageId,
|
|
88
90
|
title: pageTitle,
|
|
89
91
|
};
|
|
90
|
-
if (page.url === this.entryDocument) {
|
|
91
|
-
items = { ...items, slug: this.
|
|
92
|
+
if (page.url === this.entryDocument && this.indexSlug) {
|
|
93
|
+
items = { ...items, slug: this.indexSlug };
|
|
92
94
|
}
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if (this.sidebar.autoConfiguration) {
|
|
96
|
+
if (sidebarLabel && sidebarLabel !== pageTitle) {
|
|
97
|
+
items = { ...items, sidebar_label: sidebarLabel };
|
|
98
|
+
}
|
|
99
|
+
if (sidebarPosition) {
|
|
100
|
+
items = { ...items, sidebar_position: parseFloat(sidebarPosition) };
|
|
101
|
+
}
|
|
98
102
|
}
|
|
99
103
|
if (page.url === page.project.url && this.entryPoints.length > 1) {
|
|
100
104
|
items = { ...items, hide_table_of_contents: true };
|
|
@@ -142,15 +146,6 @@ class DocusaurusTheme extends theme_1.MarkdownTheme {
|
|
|
142
146
|
}
|
|
143
147
|
return (0, front_matter_1.getPageTitle)(page);
|
|
144
148
|
}
|
|
145
|
-
getSlug() {
|
|
146
|
-
if (this.indexSlug) {
|
|
147
|
-
return this.indexSlug;
|
|
148
|
-
}
|
|
149
|
-
if (this.out === process.cwd()) {
|
|
150
|
-
return '/';
|
|
151
|
-
}
|
|
152
|
-
return `/${path.relative(process.cwd(), this.out).replace(/\\/g, '/')}/`;
|
|
153
|
-
}
|
|
154
149
|
get mappings() {
|
|
155
150
|
return super.mappings.map((mapping) => {
|
|
156
151
|
if (mapping.kind.includes(typedoc_1.ReflectionKind.Namespace)) {
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-typedoc",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.5",
|
|
4
4
|
"description": "A Docusaurus v2 plugin to build API documentation with TypeDoc.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"typescript",
|
|
40
40
|
"api"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e4e2f96384fdc3d93b172c4ce64df56ba66f1528"
|
|
43
43
|
}
|