@docusaurus/plugin-content-docs 2.0.0-beta.0e652730d → 2.0.0-beta.10

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.
Files changed (140) hide show
  1. package/lib/.tsbuildinfo +1 -1
  2. package/lib/categoryGeneratedIndex.d.ts +12 -0
  3. package/lib/categoryGeneratedIndex.js +37 -0
  4. package/lib/cli.d.ts +2 -2
  5. package/lib/cli.js +12 -34
  6. package/lib/client/docsClientUtils.d.ts +1 -4
  7. package/lib/client/docsClientUtils.js +21 -31
  8. package/lib/docFrontMatter.d.ts +1 -1
  9. package/lib/docFrontMatter.js +10 -6
  10. package/lib/docs.d.ts +25 -3
  11. package/lib/docs.js +125 -38
  12. package/lib/globalData.d.ts +1 -1
  13. package/lib/index.d.ts +1 -1
  14. package/lib/index.js +104 -138
  15. package/lib/lastUpdate.js +9 -10
  16. package/lib/markdown/index.d.ts +3 -6
  17. package/lib/markdown/index.js +3 -3
  18. package/lib/markdown/linkify.js +2 -2
  19. package/lib/numberPrefix.d.ts +1 -1
  20. package/lib/options.d.ts +3 -3
  21. package/lib/options.js +49 -17
  22. package/lib/props.d.ts +7 -2
  23. package/lib/props.js +61 -9
  24. package/lib/routes.d.ts +27 -0
  25. package/lib/routes.js +105 -0
  26. package/lib/{sidebarItemsGenerator.d.ts → sidebars/generator.d.ts} +5 -2
  27. package/lib/sidebars/generator.js +216 -0
  28. package/lib/sidebars/index.d.ts +15 -0
  29. package/lib/sidebars/index.js +73 -0
  30. package/lib/sidebars/normalization.d.ts +14 -0
  31. package/lib/sidebars/normalization.js +77 -0
  32. package/lib/sidebars/processor.d.ts +18 -0
  33. package/lib/sidebars/processor.js +85 -0
  34. package/lib/sidebars/types.d.ts +127 -0
  35. package/lib/sidebars/types.js +8 -0
  36. package/lib/sidebars/utils.d.ts +35 -0
  37. package/lib/sidebars/utils.js +228 -0
  38. package/lib/sidebars/validation.d.ts +10 -0
  39. package/lib/sidebars/validation.js +138 -0
  40. package/lib/slug.d.ts +4 -3
  41. package/lib/slug.js +27 -15
  42. package/lib/tags.d.ts +8 -0
  43. package/lib/tags.js +20 -0
  44. package/lib/theme/hooks/useDocs.js +24 -21
  45. package/lib/translations.d.ts +2 -2
  46. package/lib/translations.js +71 -29
  47. package/lib/types.d.ts +52 -62
  48. package/lib/versions.d.ts +3 -3
  49. package/lib/versions.js +76 -24
  50. package/package.json +22 -20
  51. package/src/__tests__/__fixtures__/simple-site/docs/_partials/somePartial.md +3 -0
  52. package/src/__tests__/__fixtures__/simple-site/docs/_partials/subfolder/somePartial.md +3 -0
  53. package/src/__tests__/__fixtures__/simple-site/docs/_somePartial.md +3 -0
  54. package/src/__tests__/__fixtures__/simple-site/docs/foo/baz.md +5 -0
  55. package/src/__tests__/__fixtures__/simple-site/docs/hello.md +2 -0
  56. package/src/__tests__/__fixtures__/simple-site/docs/rootAbsoluteSlug.md +2 -0
  57. package/src/__tests__/__fixtures__/simple-site/docs/rootRelativeSlug.md +2 -0
  58. package/src/__tests__/__fixtures__/simple-site/docs/rootResolvedSlug.md +2 -0
  59. package/src/__tests__/__fixtures__/simple-site/docs/rootTryToEscapeSlug.md +2 -0
  60. package/src/__tests__/__fixtures__/simple-site/sidebars.json +15 -1
  61. package/src/__tests__/__fixtures__/site-with-doc-label/docs/hello-1.md +1 -0
  62. package/src/__tests__/__fixtures__/versioned-site/docs/foo/bar.md +6 -0
  63. package/src/__tests__/__fixtures__/versioned-site/docs/hello.md +3 -0
  64. package/src/__tests__/__fixtures__/versioned-site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
  65. package/src/__tests__/__fixtures__/versioned-site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
  66. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.0/hello.md +3 -0
  67. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/somePartial.md +3 -0
  68. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/subfolder/somePartial.md +3 -0
  69. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_somePartial.md +3 -0
  70. package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/hello.md +3 -0
  71. package/src/__tests__/__fixtures__/versioned-site/versioned_sidebars/version-1.0.1-sidebars.json +2 -2
  72. package/src/__tests__/__snapshots__/cli.test.ts.snap +48 -73
  73. package/src/__tests__/__snapshots__/docs.test.ts.snap +140 -0
  74. package/src/__tests__/__snapshots__/index.test.ts.snap +753 -112
  75. package/src/__tests__/__snapshots__/translations.test.ts.snap +45 -18
  76. package/src/__tests__/cli.test.ts +15 -11
  77. package/src/__tests__/docFrontMatter.test.ts +195 -40
  78. package/src/__tests__/docs.test.ts +311 -150
  79. package/src/__tests__/index.test.ts +112 -69
  80. package/src/__tests__/lastUpdate.test.ts +3 -2
  81. package/src/__tests__/options.test.ts +48 -4
  82. package/src/__tests__/props.test.ts +62 -0
  83. package/src/__tests__/slug.test.ts +127 -20
  84. package/src/__tests__/translations.test.ts +7 -2
  85. package/src/__tests__/versions.test.ts +93 -67
  86. package/src/categoryGeneratedIndex.ts +57 -0
  87. package/src/cli.ts +8 -41
  88. package/src/client/__tests__/docsClientUtils.test.ts +4 -5
  89. package/src/client/docsClientUtils.ts +19 -41
  90. package/{types.d.ts → src/deps.d.ts} +0 -0
  91. package/src/docFrontMatter.ts +13 -7
  92. package/src/docs.ts +158 -29
  93. package/src/globalData.ts +6 -1
  94. package/src/index.ts +134 -179
  95. package/src/lastUpdate.ts +10 -9
  96. package/src/markdown/index.ts +8 -12
  97. package/src/numberPrefix.ts +5 -3
  98. package/src/options.ts +59 -28
  99. package/src/plugin-content-docs.d.ts +179 -35
  100. package/src/props.ts +91 -16
  101. package/src/routes.ts +173 -0
  102. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-shorthand.js +0 -0
  103. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-items.json +0 -0
  104. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-label.json +0 -0
  105. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category.js +0 -0
  106. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed-first-level.json +0 -0
  107. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed.json +0 -0
  108. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-doc-id-not-string.json +0 -0
  109. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-first-level-not-category.js +0 -0
  110. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-href.json +0 -0
  111. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-label.json +0 -0
  112. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link.json +0 -0
  113. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-unknown-type.json +0 -0
  114. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-wrong-field.json +0 -0
  115. package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars.json +0 -0
  116. package/src/{__tests__/__snapshots__/sidebars.test.ts.snap → sidebars/__tests__/__snapshots__/index.test.ts.snap} +36 -6
  117. package/src/{__tests__/sidebarItemsGenerator.test.ts → sidebars/__tests__/generator.test.ts} +143 -18
  118. package/src/sidebars/__tests__/index.test.ts +204 -0
  119. package/src/sidebars/__tests__/processor.test.ts +237 -0
  120. package/src/sidebars/__tests__/utils.test.ts +695 -0
  121. package/src/sidebars/__tests__/validation.test.ts +105 -0
  122. package/src/sidebars/generator.ts +310 -0
  123. package/src/sidebars/index.ts +94 -0
  124. package/src/sidebars/normalization.ts +112 -0
  125. package/src/sidebars/processor.ts +154 -0
  126. package/src/sidebars/types.ts +211 -0
  127. package/src/sidebars/utils.ts +329 -0
  128. package/src/sidebars/validation.ts +168 -0
  129. package/src/slug.ts +32 -17
  130. package/src/tags.ts +19 -0
  131. package/src/theme/hooks/useDocs.ts +5 -1
  132. package/src/translations.ts +103 -47
  133. package/src/types.ts +67 -105
  134. package/src/versions.ts +117 -21
  135. package/lib/sidebarItemsGenerator.js +0 -211
  136. package/lib/sidebars.d.ts +0 -43
  137. package/lib/sidebars.js +0 -319
  138. package/src/__tests__/sidebars.test.ts +0 -639
  139. package/src/sidebarItemsGenerator.ts +0 -307
  140. package/src/sidebars.ts +0 -506
package/lib/versions.js CHANGED
@@ -8,16 +8,15 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.getDocsDirPaths = exports.readVersionsMetadata = exports.getVersionsFilePath = exports.getVersionedSidebarsDirPath = exports.getVersionedDocsDirPath = void 0;
10
10
  const tslib_1 = require("tslib");
11
- const path_1 = tslib_1.__importDefault(require("path"));
12
- const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
11
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
12
+ const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
13
13
  const constants_1 = require("./constants");
14
- const constants_2 = require("@docusaurus/core/lib/constants");
15
14
  const utils_1 = require("@docusaurus/utils");
16
15
  const lodash_1 = require("lodash");
17
16
  const sidebars_1 = require("./sidebars");
18
17
  // retro-compatibility: no prefix for the default plugin id
19
18
  function addPluginIdPrefix(fileOrDir, pluginId) {
20
- if (pluginId === constants_2.DEFAULT_PLUGIN_ID) {
19
+ if (pluginId === utils_1.DEFAULT_PLUGIN_ID) {
21
20
  return fileOrDir;
22
21
  }
23
22
  else {
@@ -83,7 +82,7 @@ function readVersionNames(siteDir, options) {
83
82
  return versions;
84
83
  }
85
84
  function getDocsDirPathLocalized({ siteDir, locale, pluginId, versionName, }) {
86
- return utils_1.getPluginI18nPath({
85
+ return (0, utils_1.getPluginI18nPath)({
87
86
  siteDir,
88
87
  locale,
89
88
  pluginName: 'docusaurus-plugin-content-docs',
@@ -108,7 +107,7 @@ function getVersionMetadataPaths({ versionName, context, options, }) {
108
107
  });
109
108
  function getSidebarFilePath() {
110
109
  if (isCurrentVersion) {
111
- return sidebars_1.resolveSidebarPathOption(context.siteDir, options.sidebarPath);
110
+ return (0, sidebars_1.resolveSidebarPathOption)(context.siteDir, options.sidebarPath);
112
111
  }
113
112
  else {
114
113
  return path_1.default.join(getVersionedSidebarsDirPath(context.siteDir, options.id), `version-${versionName}-sidebars.json`);
@@ -138,10 +137,10 @@ function getVersionEditUrls({ contentPath, contentPathLocalized, context: { site
138
137
  pluginId: id,
139
138
  })
140
139
  : contentPathLocalized;
141
- const versionPathSegment = utils_1.posixPath(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPath)));
142
- const versionPathSegmentLocalized = utils_1.posixPath(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPathLocalized)));
143
- const versionEditUrl = utils_1.normalizeUrl([editUrl, versionPathSegment]);
144
- const versionEditUrlLocalized = utils_1.normalizeUrl([
140
+ const versionPathSegment = (0, utils_1.posixPath)(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPath)));
141
+ const versionPathSegmentLocalized = (0, utils_1.posixPath)(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPathLocalized)));
142
+ const versionEditUrl = (0, utils_1.normalizeUrl)([editUrl, versionPathSegment]);
143
+ const versionEditUrlLocalized = (0, utils_1.normalizeUrl)([
145
144
  editUrl,
146
145
  versionPathSegmentLocalized,
147
146
  ]);
@@ -150,24 +149,64 @@ function getVersionEditUrls({ contentPath, contentPathLocalized, context: { site
150
149
  versionEditUrlLocalized,
151
150
  };
152
151
  }
153
- function createVersionMetadata({ versionName, isLast, context, options, }) {
154
- var _a, _b, _c;
155
- const { sidebarFilePath, contentPath, contentPathLocalized, } = getVersionMetadataPaths({
152
+ function getDefaultVersionBanner({ versionName, versionNames, lastVersionName, }) {
153
+ // Current version: good, no banner
154
+ if (versionName === lastVersionName) {
155
+ return null;
156
+ }
157
+ // Upcoming versions: unreleased banner
158
+ else if (versionNames.indexOf(versionName) < versionNames.indexOf(lastVersionName)) {
159
+ return 'unreleased';
160
+ }
161
+ // Older versions: display unmaintained banner
162
+ else {
163
+ return 'unmaintained';
164
+ }
165
+ }
166
+ function getVersionBanner({ versionName, versionNames, lastVersionName, options, }) {
167
+ var _a;
168
+ const versionBannerOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.banner;
169
+ if (versionBannerOption) {
170
+ return versionBannerOption === 'none' ? null : versionBannerOption;
171
+ }
172
+ return getDefaultVersionBanner({
156
173
  versionName,
157
- context,
158
- options,
174
+ versionNames,
175
+ lastVersionName,
159
176
  });
177
+ }
178
+ function getVersionBadge({ versionName, versionNames, options, }) {
179
+ var _a;
180
+ const versionBadgeOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.badge;
181
+ // If site is not versioned or only one version is included
182
+ // we don't show the version badge by default
183
+ // See https://github.com/facebook/docusaurus/issues/3362
184
+ const versionBadgeDefault = versionNames.length !== 1;
185
+ return versionBadgeOption !== null && versionBadgeOption !== void 0 ? versionBadgeOption : versionBadgeDefault;
186
+ }
187
+ function getVersionClassName({ versionName, options, }) {
188
+ var _a;
189
+ const versionClassNameOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.className;
190
+ const versionClassNameDefault = `docs-version-${versionName}`;
191
+ return versionClassNameOption !== null && versionClassNameOption !== void 0 ? versionClassNameOption : versionClassNameDefault;
192
+ }
193
+ function createVersionMetadata({ versionName, versionNames, lastVersionName, context, options, }) {
194
+ var _a, _b, _c;
195
+ const { sidebarFilePath, contentPath, contentPathLocalized } = getVersionMetadataPaths({ versionName, context, options });
196
+ const isLast = versionName === lastVersionName;
160
197
  // retro-compatible values
161
198
  const defaultVersionLabel = versionName === constants_1.CURRENT_VERSION_NAME ? 'Next' : versionName;
162
- const defaultVersionPathPart = isLast
163
- ? ''
164
- : versionName === constants_1.CURRENT_VERSION_NAME
165
- ? 'next'
166
- : versionName;
199
+ function getDefaultVersionPathPart() {
200
+ if (isLast) {
201
+ return '';
202
+ }
203
+ return versionName === constants_1.CURRENT_VERSION_NAME ? 'next' : versionName;
204
+ }
205
+ const defaultVersionPathPart = getDefaultVersionPathPart();
167
206
  const versionOptions = (_a = options.versions[versionName]) !== null && _a !== void 0 ? _a : {};
168
207
  const versionLabel = (_b = versionOptions.label) !== null && _b !== void 0 ? _b : defaultVersionLabel;
169
208
  const versionPathPart = (_c = versionOptions.path) !== null && _c !== void 0 ? _c : defaultVersionPathPart;
170
- const versionPath = utils_1.normalizeUrl([
209
+ const versionPath = (0, utils_1.normalizeUrl)([
171
210
  context.baseUrl,
172
211
  options.routeBasePath,
173
212
  versionPathPart,
@@ -180,12 +219,24 @@ function createVersionMetadata({ versionName, isLast, context, options, }) {
180
219
  });
181
220
  // Because /docs/:route` should always be after `/docs/versionName/:route`.
182
221
  const routePriority = versionPathPart === '' ? -1 : undefined;
222
+ // the path that will be used to refer the docs tags
223
+ // example below will be using /docs/tags
224
+ const tagsPath = (0, utils_1.normalizeUrl)([versionPath, options.tagsBasePath]);
183
225
  return {
184
226
  versionName,
185
227
  versionLabel,
186
228
  versionPath,
229
+ tagsPath,
187
230
  versionEditUrl: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrl,
188
231
  versionEditUrlLocalized: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrlLocalized,
232
+ versionBanner: getVersionBanner({
233
+ versionName,
234
+ versionNames,
235
+ lastVersionName,
236
+ options,
237
+ }),
238
+ versionBadge: getVersionBadge({ versionName, versionNames, options }),
239
+ versionClassName: getVersionClassName({ versionName, options }),
189
240
  isLast,
190
241
  routePriority,
191
242
  sidebarFilePath,
@@ -231,7 +282,7 @@ function checkVersionsOptions(availableVersionNames, options) {
231
282
  !availableVersionNames.includes(options.lastVersion)) {
232
283
  throw new Error(`Docs option lastVersion=${options.lastVersion} is invalid. ${availableVersionNamesMsg}`);
233
284
  }
234
- const unknownVersionConfigNames = lodash_1.difference(Object.keys(options.versions), availableVersionNames);
285
+ const unknownVersionConfigNames = (0, lodash_1.difference)(Object.keys(options.versions), availableVersionNames);
235
286
  if (unknownVersionConfigNames.length > 0) {
236
287
  throw new Error(`Invalid docs option "versions": unknown versions (${unknownVersionConfigNames.join(',')}) found. ${availableVersionNamesMsg}`);
237
288
  }
@@ -239,7 +290,7 @@ function checkVersionsOptions(availableVersionNames, options) {
239
290
  if (options.onlyIncludeVersions.length === 0) {
240
291
  throw new Error(`Invalid docs option "onlyIncludeVersions": an empty array is not allowed, at least one version is needed.`);
241
292
  }
242
- const unknownOnlyIncludeVersionNames = lodash_1.difference(options.onlyIncludeVersions, availableVersionNames);
293
+ const unknownOnlyIncludeVersionNames = (0, lodash_1.difference)(options.onlyIncludeVersions, availableVersionNames);
243
294
  if (unknownOnlyIncludeVersionNames.length > 0) {
244
295
  throw new Error(`Invalid docs option "onlyIncludeVersions": unknown versions (${unknownOnlyIncludeVersionNames.join(',')}) found. ${availableVersionNamesMsg}`);
245
296
  }
@@ -269,7 +320,8 @@ function readVersionsMetadata({ context, options, }) {
269
320
  const lastVersionName = (_a = options.lastVersion) !== null && _a !== void 0 ? _a : getDefaultLastVersionName(versionNames);
270
321
  const versionsMetadata = versionNames.map((versionName) => createVersionMetadata({
271
322
  versionName,
272
- isLast: versionName === lastVersionName,
323
+ versionNames,
324
+ lastVersionName,
273
325
  context,
274
326
  options,
275
327
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-docs",
3
- "version": "2.0.0-beta.0e652730d",
3
+ "version": "2.0.0-beta.10",
4
4
  "description": "Docs plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-docs.d.ts",
@@ -17,40 +17,42 @@
17
17
  "directory": "packages/docusaurus-plugin-content-docs"
18
18
  },
19
19
  "license": "MIT",
20
- "devDependencies": {
21
- "@docusaurus/module-type-aliases": "2.0.0-beta.0e652730d",
22
- "@types/js-yaml": "^4.0.0",
23
- "@types/picomatch": "^2.2.1",
24
- "commander": "^5.1.0",
25
- "picomatch": "^2.1.1"
26
- },
27
20
  "dependencies": {
28
- "@docusaurus/core": "2.0.0-beta.0e652730d",
29
- "@docusaurus/mdx-loader": "2.0.0-beta.0e652730d",
30
- "@docusaurus/types": "2.0.0-beta.0e652730d",
31
- "@docusaurus/utils": "2.0.0-beta.0e652730d",
32
- "@docusaurus/utils-validation": "2.0.0-beta.0e652730d",
33
- "chalk": "^4.1.1",
21
+ "@docusaurus/mdx-loader": "2.0.0-beta.10",
22
+ "@docusaurus/utils": "2.0.0-beta.10",
23
+ "@docusaurus/utils-validation": "2.0.0-beta.10",
24
+ "chalk": "^4.1.2",
34
25
  "combine-promises": "^1.1.0",
35
- "execa": "^5.0.0",
26
+ "escape-string-regexp": "^4.0.0",
36
27
  "fs-extra": "^10.0.0",
37
28
  "globby": "^11.0.2",
38
29
  "import-fresh": "^3.2.2",
39
30
  "js-yaml": "^4.0.0",
40
- "loader-utils": "^1.2.3",
31
+ "loader-utils": "^2.0.0",
41
32
  "lodash": "^4.17.20",
42
33
  "remark-admonitions": "^1.2.1",
43
34
  "shelljs": "^0.8.4",
44
- "tslib": "^2.2.0",
35
+ "tslib": "^2.3.1",
45
36
  "utility-types": "^3.10.0",
46
- "webpack": "^5.37.0"
37
+ "webpack": "^5.61.0"
38
+ },
39
+ "devDependencies": {
40
+ "@docusaurus/core": "2.0.0-beta.10",
41
+ "@docusaurus/module-type-aliases": "2.0.0-beta.10",
42
+ "@docusaurus/types": "2.0.0-beta.10",
43
+ "@types/js-yaml": "^4.0.0",
44
+ "@types/picomatch": "^2.2.1",
45
+ "commander": "^5.1.0",
46
+ "picomatch": "^2.1.1",
47
+ "utility-types": "^3.10.0"
47
48
  },
48
49
  "peerDependencies": {
50
+ "@docusaurus/core": "2.0.0-beta.9",
49
51
  "react": "^16.8.4 || ^17.0.0",
50
52
  "react-dom": "^16.8.4 || ^17.0.0"
51
53
  },
52
54
  "engines": {
53
- "node": ">=12.13.0"
55
+ "node": ">=14"
54
56
  },
55
- "gitHead": "295893e14eedbbfad2eefb39ec5219404547fc31"
57
+ "gitHead": "6f4869af5721435d6995e63e2f24ac41646e34ea"
56
58
  }
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with \_:
2
+
3
+ It should be excluded by default
@@ -3,6 +3,11 @@ id: baz
3
3
  title: baz
4
4
  slug: bazSlug.html
5
5
  pagination_label: baz pagination_label
6
+ tags:
7
+ - tag 1
8
+ - tag-1
9
+ - label: tag 2
10
+ permalink: tag2-custom-permalink
6
11
  ---
7
12
 
8
13
  # Baz markdown title
@@ -2,6 +2,8 @@
2
2
  id: hello
3
3
  title: Hello, World !
4
4
  sidebar_label: Hello sidebar_label
5
+ tags: [tag-1, tag 3]
6
+ slug: /
5
7
  ---
6
8
 
7
9
  Hi, Endilie here :)
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: /rootAbsoluteSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: rootRelativeSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: ./hey/ho/../rootResolvedSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  slug: ../../../../../../../../rootTryToEscapeSlug
3
+ pagination_next: headingAsTitle
4
+ pagination_prev: foo/baz
3
5
  ---
4
6
 
5
7
  Lorem
@@ -4,7 +4,21 @@
4
4
  {
5
5
  "type": "category",
6
6
  "label": "foo",
7
- "items": ["foo/bar", "foo/baz"]
7
+ "items": ["foo/bar", "foo/baz"]
8
+ },
9
+ {
10
+ "type": "category",
11
+ "label": "Slugs",
12
+ "items": [
13
+ "rootAbsoluteSlug",
14
+ "rootRelativeSlug",
15
+ "rootResolvedSlug",
16
+ "rootTryToEscapeSlug"
17
+ ]
18
+ },
19
+ {
20
+ "type": "doc",
21
+ "id": "headingAsTitle"
8
22
  },
9
23
  {
10
24
  "type": "link",
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  id: hello-1
3
3
  title: Hello 1
4
+ slug: /
4
5
  ---
5
6
 
6
7
  Hello World 1!
@@ -1,4 +1,10 @@
1
1
  ---
2
2
  slug: barSlug
3
+ tags:
4
+ - barTag 1
5
+ - barTag-2
6
+ - label: barTag 3
7
+ permalink: barTag-3-permalink
3
8
  ---
9
+
4
10
  This is `next` version of bar.
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `next` !
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.0` ! (translated en)
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.0` ! (translated fr)
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.0` !
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with _:
2
+
3
+ It should be excluded by default
@@ -0,0 +1,3 @@
1
+ This is a partial in file/folder starting with \_:
2
+
3
+ It should be excluded by default
@@ -1 +1,4 @@
1
+ ---
2
+ slug: /
3
+ ---
1
4
  Hello `1.0.1` !
@@ -1,7 +1,7 @@
1
1
  {
2
- "version-1.0.1/docs": {
2
+ "VersionedSideBarNameDoesNotMatter/docs": {
3
3
  "Test": [
4
- "version-1.0.1/foo/bar"
4
+ "foo/bar"
5
5
  ],
6
6
  "Guides": [
7
7
  "version-1.0.1/hello"
@@ -2,89 +2,64 @@
2
2
 
3
3
  exports[`docsVersion first time versioning 1`] = `
4
4
  Object {
5
- "version-1.0.0/docs": Array [
6
- Object {
7
- "collapsed": true,
8
- "items": Array [
9
- Object {
10
- "collapsed": true,
11
- "items": Array [
12
- Object {
13
- "id": "version-1.0.0/foo/bar",
14
- "type": "doc",
15
- },
16
- Object {
17
- "id": "version-1.0.0/foo/baz",
18
- "type": "doc",
19
- },
20
- ],
21
- "label": "foo",
22
- "type": "category",
23
- },
24
- Object {
25
- "href": "https://github.com",
26
- "label": "Github",
27
- "type": "link",
28
- },
29
- Object {
30
- "id": "version-1.0.0/hello",
31
- "type": "ref",
32
- },
33
- ],
34
- "label": "Test",
35
- "type": "category",
36
- },
37
- Object {
38
- "collapsed": true,
39
- "items": Array [
40
- Object {
41
- "id": "version-1.0.0/hello",
42
- "type": "doc",
43
- },
44
- ],
45
- "label": "Guides",
46
- "type": "category",
47
- },
48
- ],
5
+ "docs": Object {
6
+ "Guides": Array [
7
+ "hello",
8
+ ],
9
+ "Test": Array [
10
+ Object {
11
+ "items": Array [
12
+ "foo/bar",
13
+ "foo/baz",
14
+ ],
15
+ "label": "foo",
16
+ "type": "category",
17
+ },
18
+ Object {
19
+ "items": Array [
20
+ "rootAbsoluteSlug",
21
+ "rootRelativeSlug",
22
+ "rootResolvedSlug",
23
+ "rootTryToEscapeSlug",
24
+ ],
25
+ "label": "Slugs",
26
+ "type": "category",
27
+ },
28
+ Object {
29
+ "id": "headingAsTitle",
30
+ "type": "doc",
31
+ },
32
+ Object {
33
+ "href": "https://github.com",
34
+ "label": "Github",
35
+ "type": "link",
36
+ },
37
+ Object {
38
+ "id": "hello",
39
+ "type": "ref",
40
+ },
41
+ ],
42
+ },
49
43
  }
50
44
  `;
51
45
 
52
46
  exports[`docsVersion not the first time versioning 1`] = `
53
47
  Object {
54
- "version-2.0.0/docs": Array [
55
- Object {
56
- "collapsed": true,
57
- "items": Array [
58
- Object {
59
- "id": "version-2.0.0/foo/bar",
60
- "type": "doc",
61
- },
62
- ],
63
- "label": "Test",
64
- "type": "category",
65
- },
66
- Object {
67
- "collapsed": true,
68
- "items": Array [
69
- Object {
70
- "id": "version-2.0.0/hello",
71
- "type": "doc",
72
- },
73
- ],
74
- "label": "Guides",
75
- "type": "category",
76
- },
77
- ],
48
+ "docs": Object {
49
+ "Guides": Array [
50
+ "hello",
51
+ ],
52
+ "Test": Array [
53
+ "foo/bar",
54
+ ],
55
+ },
78
56
  }
79
57
  `;
80
58
 
81
59
  exports[`docsVersion second docs instance versioning 1`] = `
82
60
  Object {
83
- "version-2.0.0/community": Array [
84
- Object {
85
- "id": "version-2.0.0/team",
86
- "type": "doc",
87
- },
61
+ "community": Array [
62
+ "team",
88
63
  ],
89
64
  }
90
65
  `;