docusaurus-plugin-openapi-docs 2.0.0-beta.0 → 2.0.0-beta.2
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/README.md +7 -7
- package/lib/markdown/createRequestSchema.js +1 -1
- package/lib/options.js +1 -2
- package/lib/sidebars/index.js +2 -2
- package/lib/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/markdown/createRequestSchema.ts +1 -1
- package/src/options.ts +1 -2
- package/src/sidebars/index.ts +2 -2
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -133,13 +133,13 @@ The `docusaurus-plugin-openapi-docs` plugin can be configured with the following
|
|
|
133
133
|
|
|
134
134
|
`sidebarOptions` can be configured with the following options:
|
|
135
135
|
|
|
136
|
-
| Name | Type | Default | Description
|
|
137
|
-
| -------------------- | --------- | ------- |
|
|
138
|
-
| `groupPathsBy` | `string` | `null` | Organize and group sidebar slice by specified option. Note: Currently, `groupPathsBy` only contains support for grouping by `tag`.
|
|
139
|
-
| `categoryLinkSource` | `string` | `null` | Defines what source to use for rendering category
|
|
140
|
-
| `sidebarCollapsible` | `boolean` | `true` | Whether sidebar categories are collapsible by default.
|
|
141
|
-
| `sidebarCollapsed` | `boolean` | `true` | Whether sidebar categories are collapsed by default.
|
|
142
|
-
| `customProps` | `object` | `null` | Additional props for customizing a sidebar item.
|
|
136
|
+
| Name | Type | Default | Description |
|
|
137
|
+
| -------------------- | --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
138
|
+
| `groupPathsBy` | `string` | `null` | Organize and group sidebar slice by specified option. Note: Currently, `groupPathsBy` only contains support for grouping by `tag`. |
|
|
139
|
+
| `categoryLinkSource` | `string` | `null` | Defines what source to use for rendering category pages when grouping paths by tag. By default, pages are not created for categories, only groups that can be expanded/collapsed. <br/><br/>The supported options are as follows: <br/><br/> `auto`: Sets the category link config type to `generated-index`, building an index page with links to each page in the group.<br/><br/> `tag`: Sets the category link config type to `generated-index` and uses the tag description at the top of the page. <br/><br/>`info`: Sets the category link config type to `doc` and renders the `info` section as the category link (recommended only for multi/micro-spec scenarios). |
|
|
140
|
+
| `sidebarCollapsible` | `boolean` | `true` | Whether sidebar categories are collapsible by default. |
|
|
141
|
+
| `sidebarCollapsed` | `boolean` | `true` | Whether sidebar categories are collapsed by default. |
|
|
142
|
+
| `customProps` | `object` | `null` | Additional props for customizing a sidebar item. |
|
|
143
143
|
|
|
144
144
|
> You may optionally configure a `sidebarOptions`. In doing so, an individual `sidebar.js` slice with the configured options will be generated within the respective `outputDir`.
|
|
145
145
|
|
package/lib/options.js
CHANGED
|
@@ -10,8 +10,7 @@ exports.OptionsSchema = void 0;
|
|
|
10
10
|
const utils_validation_1 = require("@docusaurus/utils-validation");
|
|
11
11
|
const sidebarOptions = utils_validation_1.Joi.object({
|
|
12
12
|
groupPathsBy: utils_validation_1.Joi.string().valid("tag"),
|
|
13
|
-
|
|
14
|
-
categoryLinkSource: utils_validation_1.Joi.string().valid("tag", "info", "none"),
|
|
13
|
+
categoryLinkSource: utils_validation_1.Joi.string().valid("tag", "info", "auto"),
|
|
15
14
|
customProps: utils_validation_1.Joi.object(),
|
|
16
15
|
sidebarCollapsible: utils_validation_1.Joi.boolean(),
|
|
17
16
|
sidebarCollapsed: utils_validation_1.Joi.boolean(),
|
package/lib/sidebars/index.js
CHANGED
|
@@ -90,6 +90,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
|
90
90
|
};
|
|
91
91
|
});
|
|
92
92
|
// TODO: perhaps move this into a getLinkConfig() function
|
|
93
|
+
// Default to no link config (spindowns only)
|
|
93
94
|
let linkConfig = undefined;
|
|
94
95
|
if (taggedInfoObject !== undefined && categoryLinkSource === "info") {
|
|
95
96
|
linkConfig = {
|
|
@@ -107,8 +108,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
|
107
108
|
id: basePath === "" || undefined ? `${tagId}` : `${basePath}/${tagId}`,
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
-
if (categoryLinkSource === undefined) {
|
|
111
|
+
if (categoryLinkSource === "auto") {
|
|
112
112
|
linkConfig = {
|
|
113
113
|
type: "generated-index",
|
|
114
114
|
title: tag,
|
package/lib/types.d.ts
CHANGED
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": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.2",
|
|
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": "ba8fd77e6b9e90e0bca5e169fbc1c71ac50f44e0"
|
|
72
72
|
}
|
package/src/options.ts
CHANGED
|
@@ -9,8 +9,7 @@ import { Joi } from "@docusaurus/utils-validation";
|
|
|
9
9
|
|
|
10
10
|
const sidebarOptions = Joi.object({
|
|
11
11
|
groupPathsBy: Joi.string().valid("tag"),
|
|
12
|
-
|
|
13
|
-
categoryLinkSource: Joi.string().valid("tag", "info", "none"),
|
|
12
|
+
categoryLinkSource: Joi.string().valid("tag", "info", "auto"),
|
|
14
13
|
customProps: Joi.object(),
|
|
15
14
|
sidebarCollapsible: Joi.boolean(),
|
|
16
15
|
sidebarCollapsed: Joi.boolean(),
|
package/src/sidebars/index.ts
CHANGED
|
@@ -130,6 +130,7 @@ function groupByTags(
|
|
|
130
130
|
);
|
|
131
131
|
|
|
132
132
|
// TODO: perhaps move this into a getLinkConfig() function
|
|
133
|
+
// Default to no link config (spindowns only)
|
|
133
134
|
let linkConfig = undefined;
|
|
134
135
|
if (taggedInfoObject !== undefined && categoryLinkSource === "info") {
|
|
135
136
|
linkConfig = {
|
|
@@ -151,8 +152,7 @@ function groupByTags(
|
|
|
151
152
|
} as SidebarItemCategoryLinkConfig;
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
|
|
155
|
-
if (categoryLinkSource === undefined) {
|
|
155
|
+
if (categoryLinkSource === "auto") {
|
|
156
156
|
linkConfig = {
|
|
157
157
|
type: "generated-index" as "generated-index",
|
|
158
158
|
title: tag,
|
package/src/types.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface APIOptions {
|
|
|
46
46
|
|
|
47
47
|
export interface SidebarOptions {
|
|
48
48
|
groupPathsBy?: string;
|
|
49
|
-
categoryLinkSource?:
|
|
49
|
+
categoryLinkSource?: "info" | "tag" | "auto";
|
|
50
50
|
customProps?: { [key: string]: unknown };
|
|
51
51
|
sidebarCollapsible?: boolean;
|
|
52
52
|
sidebarCollapsed?: boolean;
|