docusaurus-plugin-openapi-docs 0.0.0-557 → 0.0.0-558
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 -0
- package/lib/sidebars/index.js +3 -1
- package/package.json +2 -2
- package/src/index.ts +3 -0
- package/src/sidebars/index.ts +6 -1
package/lib/index.js
CHANGED
|
@@ -77,6 +77,8 @@ function pluginOpenAPIDocs(context, options) {
|
|
|
77
77
|
let docPath = docData ? (docData.path ? docData.path : "docs") : undefined;
|
|
78
78
|
async function generateApiDocs(options, pluginId) {
|
|
79
79
|
let { specPath, outputDir, template, downloadUrl, sidebarOptions } = options;
|
|
80
|
+
// Remove trailing slash before proceeding
|
|
81
|
+
outputDir = outputDir.replace(/\/$/, "");
|
|
80
82
|
// Override docPath if pluginId provided
|
|
81
83
|
if (pluginId) {
|
|
82
84
|
docData = getDocsPluginConfig(presetsPlugins, pluginId);
|
package/lib/sidebars/index.js
CHANGED
|
@@ -21,7 +21,9 @@ function isInfoItem(item) {
|
|
|
21
21
|
return item.type === "info";
|
|
22
22
|
}
|
|
23
23
|
function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
24
|
-
|
|
24
|
+
let { outputDir, label } = options;
|
|
25
|
+
// Remove trailing slash before proceeding
|
|
26
|
+
outputDir = outputDir.replace(/\/$/, "");
|
|
25
27
|
const { sidebarCollapsed, sidebarCollapsible, customProps, categoryLinkSource, } = sidebarOptions;
|
|
26
28
|
const apiItems = items.filter(isApiItem);
|
|
27
29
|
const infoItems = items.filter(isInfoItem);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-558",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b204f629faf18501c4b2c31f3129f345cd130b86"
|
|
72
72
|
}
|
package/src/index.ts
CHANGED
|
@@ -94,6 +94,9 @@ export default function pluginOpenAPIDocs(
|
|
|
94
94
|
let { specPath, outputDir, template, downloadUrl, sidebarOptions } =
|
|
95
95
|
options;
|
|
96
96
|
|
|
97
|
+
// Remove trailing slash before proceeding
|
|
98
|
+
outputDir = outputDir.replace(/\/$/, "");
|
|
99
|
+
|
|
97
100
|
// Override docPath if pluginId provided
|
|
98
101
|
if (pluginId) {
|
|
99
102
|
docData = getDocsPluginConfig(presetsPlugins, pluginId);
|
package/src/sidebars/index.ts
CHANGED
|
@@ -41,7 +41,11 @@ function groupByTags(
|
|
|
41
41
|
tags: TagObject[][],
|
|
42
42
|
docPath: string
|
|
43
43
|
): ProcessedSidebar {
|
|
44
|
-
|
|
44
|
+
let { outputDir, label } = options;
|
|
45
|
+
|
|
46
|
+
// Remove trailing slash before proceeding
|
|
47
|
+
outputDir = outputDir.replace(/\/$/, "");
|
|
48
|
+
|
|
45
49
|
const {
|
|
46
50
|
sidebarCollapsed,
|
|
47
51
|
sidebarCollapsible,
|
|
@@ -214,6 +218,7 @@ export default function generateSidebarSlice(
|
|
|
214
218
|
docPath: string
|
|
215
219
|
) {
|
|
216
220
|
let sidebarSlice: ProcessedSidebar = [];
|
|
221
|
+
|
|
217
222
|
if (sidebarOptions.groupPathsBy === "tag") {
|
|
218
223
|
sidebarSlice = groupByTags(
|
|
219
224
|
api as ApiPageMetadata[],
|