@docusaurus/plugin-content-docs 0.0.0-4591 → 0.0.0-4595
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/lib/index.js +2 -1
- package/lib/options.js +2 -0
- package/lib/sidebars/types.d.ts +1 -0
- package/package.json +9 -9
- package/src/index.ts +2 -0
- package/src/options.ts +2 -0
- package/src/plugin-content-docs.d.ts +8 -0
- package/src/sidebars/types.ts +4 -0
package/lib/index.js
CHANGED
|
@@ -133,7 +133,7 @@ async function pluginContentDocs(context, options) {
|
|
|
133
133
|
},
|
|
134
134
|
async contentLoaded({ content, actions }) {
|
|
135
135
|
const { loadedVersions } = content;
|
|
136
|
-
const { docLayoutComponent, docItemComponent, docCategoryGeneratedIndexComponent, } = options;
|
|
136
|
+
const { docLayoutComponent, docItemComponent, docCategoryGeneratedIndexComponent, breadcrumbs, } = options;
|
|
137
137
|
const { addRoute, createData, setGlobalData } = actions;
|
|
138
138
|
async function createVersionTagsRoutes(version) {
|
|
139
139
|
const versionTags = (0, tags_1.getVersionTags)(version.docs);
|
|
@@ -191,6 +191,7 @@ async function pluginContentDocs(context, options) {
|
|
|
191
191
|
setGlobalData({
|
|
192
192
|
path: (0, utils_1.normalizeUrl)([baseUrl, options.routeBasePath]),
|
|
193
193
|
versions: loadedVersions.map(globalData_1.toGlobalDataVersion),
|
|
194
|
+
breadcrumbs,
|
|
194
195
|
});
|
|
195
196
|
},
|
|
196
197
|
configureWebpack(_config, isServer, utils, content) {
|
package/lib/options.js
CHANGED
|
@@ -42,6 +42,7 @@ exports.DEFAULT_OPTIONS = {
|
|
|
42
42
|
editLocalizedFiles: false,
|
|
43
43
|
sidebarCollapsible: true,
|
|
44
44
|
sidebarCollapsed: true,
|
|
45
|
+
breadcrumbs: true,
|
|
45
46
|
};
|
|
46
47
|
const VersionOptionsSchema = utils_validation_1.Joi.object({
|
|
47
48
|
path: utils_validation_1.Joi.string().allow('').optional(),
|
|
@@ -98,6 +99,7 @@ exports.OptionsSchema = utils_validation_1.Joi.object({
|
|
|
98
99
|
disableVersioning: utils_validation_1.Joi.bool().default(exports.DEFAULT_OPTIONS.disableVersioning),
|
|
99
100
|
lastVersion: utils_validation_1.Joi.string().optional(),
|
|
100
101
|
versions: VersionsOptionsSchema,
|
|
102
|
+
breadcrumbs: utils_validation_1.Joi.bool().default(exports.DEFAULT_OPTIONS.breadcrumbs),
|
|
101
103
|
});
|
|
102
104
|
function validateOptions({ validate, options: userOptions, }) {
|
|
103
105
|
let options = userOptions;
|
package/lib/sidebars/types.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ export declare type PropSidebar = PropSidebarItem[];
|
|
|
121
121
|
export declare type PropSidebars = {
|
|
122
122
|
[sidebarId: string]: PropSidebar;
|
|
123
123
|
};
|
|
124
|
+
export declare type PropSidebarBreadcrumbsItem = PropSidebarItemLink | PropSidebarItemCategory;
|
|
124
125
|
export declare type PropVersionDoc = {
|
|
125
126
|
id: string;
|
|
126
127
|
title: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-docs",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4595",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@docusaurus/core": "0.0.0-
|
|
27
|
-
"@docusaurus/logger": "0.0.0-
|
|
28
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
29
|
-
"@docusaurus/utils": "0.0.0-
|
|
30
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
26
|
+
"@docusaurus/core": "0.0.0-4595",
|
|
27
|
+
"@docusaurus/logger": "0.0.0-4595",
|
|
28
|
+
"@docusaurus/mdx-loader": "0.0.0-4595",
|
|
29
|
+
"@docusaurus/utils": "0.0.0-4595",
|
|
30
|
+
"@docusaurus/utils-validation": "0.0.0-4595",
|
|
31
31
|
"combine-promises": "^1.1.0",
|
|
32
32
|
"fs-extra": "^10.0.0",
|
|
33
33
|
"import-fresh": "^3.3.0",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"webpack": "^5.68.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
43
|
-
"@docusaurus/types": "0.0.0-
|
|
42
|
+
"@docusaurus/module-type-aliases": "0.0.0-4595",
|
|
43
|
+
"@docusaurus/types": "0.0.0-4595",
|
|
44
44
|
"@types/js-yaml": "^4.0.5",
|
|
45
45
|
"@types/picomatch": "^2.3.0",
|
|
46
46
|
"commander": "^5.1.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=14"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "3bd73b49c00b9438753da2f060eba352b1f8536b"
|
|
60
60
|
}
|
package/src/index.ts
CHANGED
|
@@ -217,6 +217,7 @@ export default async function pluginContentDocs(
|
|
|
217
217
|
docLayoutComponent,
|
|
218
218
|
docItemComponent,
|
|
219
219
|
docCategoryGeneratedIndexComponent,
|
|
220
|
+
breadcrumbs,
|
|
220
221
|
} = options;
|
|
221
222
|
const {addRoute, createData, setGlobalData} = actions;
|
|
222
223
|
|
|
@@ -295,6 +296,7 @@ export default async function pluginContentDocs(
|
|
|
295
296
|
setGlobalData<GlobalPluginData>({
|
|
296
297
|
path: normalizeUrl([baseUrl, options.routeBasePath]),
|
|
297
298
|
versions: loadedVersions.map(toGlobalDataVersion),
|
|
299
|
+
breadcrumbs,
|
|
298
300
|
});
|
|
299
301
|
},
|
|
300
302
|
|
package/src/options.ts
CHANGED
|
@@ -55,6 +55,7 @@ export const DEFAULT_OPTIONS: Omit<PluginOptions, 'id' | 'sidebarPath'> = {
|
|
|
55
55
|
editLocalizedFiles: false,
|
|
56
56
|
sidebarCollapsible: true,
|
|
57
57
|
sidebarCollapsed: true,
|
|
58
|
+
breadcrumbs: true,
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
const VersionOptionsSchema = Joi.object({
|
|
@@ -139,6 +140,7 @@ export const OptionsSchema = Joi.object({
|
|
|
139
140
|
disableVersioning: Joi.bool().default(DEFAULT_OPTIONS.disableVersioning),
|
|
140
141
|
lastVersion: Joi.string().optional(),
|
|
141
142
|
versions: VersionsOptionsSchema,
|
|
143
|
+
breadcrumbs: Joi.bool().default(DEFAULT_OPTIONS.breadcrumbs),
|
|
142
144
|
});
|
|
143
145
|
|
|
144
146
|
export function validateOptions({
|
|
@@ -38,6 +38,7 @@ declare module '@docusaurus/plugin-content-docs' {
|
|
|
38
38
|
showLastUpdateTime?: boolean;
|
|
39
39
|
showLastUpdateAuthor?: boolean;
|
|
40
40
|
numberPrefixParser: NumberPrefixParser;
|
|
41
|
+
breadcrumbs: boolean;
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
export type PathOptions = {
|
|
@@ -126,6 +127,8 @@ declare module '@docusaurus/plugin-content-docs' {
|
|
|
126
127
|
export type PropSidebarItemCategory =
|
|
127
128
|
import('./sidebars/types').PropSidebarItemCategory;
|
|
128
129
|
export type PropSidebarItem = import('./sidebars/types').PropSidebarItem;
|
|
130
|
+
export type PropSidebarBreadcrumbsItem =
|
|
131
|
+
import('./sidebars/types').PropSidebarBreadcrumbsItem;
|
|
129
132
|
export type PropSidebar = import('./sidebars/types').PropSidebar;
|
|
130
133
|
export type PropSidebars = import('./sidebars/types').PropSidebars;
|
|
131
134
|
|
|
@@ -237,6 +240,10 @@ declare module '@theme/DocTagDocListPage' {
|
|
|
237
240
|
export default function DocTagDocListPage(props: Props): JSX.Element;
|
|
238
241
|
}
|
|
239
242
|
|
|
243
|
+
declare module '@theme/DocBreadcrumbs' {
|
|
244
|
+
export default function DocBreadcrumbs(): JSX.Element;
|
|
245
|
+
}
|
|
246
|
+
|
|
240
247
|
declare module '@theme/DocPage' {
|
|
241
248
|
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
|
|
242
249
|
import type {DocumentRoute} from '@theme/DocItem';
|
|
@@ -294,6 +301,7 @@ declare module '@docusaurus/plugin-content-docs/client' {
|
|
|
294
301
|
export type GlobalPluginData = {
|
|
295
302
|
path: string;
|
|
296
303
|
versions: GlobalVersion[];
|
|
304
|
+
breadcrumbs: boolean;
|
|
297
305
|
};
|
|
298
306
|
export type DocVersionSuggestions = {
|
|
299
307
|
// suggest the latest version
|
package/src/sidebars/types.ts
CHANGED
|
@@ -195,6 +195,10 @@ export type PropSidebars = {
|
|
|
195
195
|
[sidebarId: string]: PropSidebar;
|
|
196
196
|
};
|
|
197
197
|
|
|
198
|
+
export type PropSidebarBreadcrumbsItem =
|
|
199
|
+
| PropSidebarItemLink
|
|
200
|
+
| PropSidebarItemCategory;
|
|
201
|
+
|
|
198
202
|
export type PropVersionDoc = {
|
|
199
203
|
id: string;
|
|
200
204
|
title: string;
|