@docusaurus/plugin-content-docs 2.4.1 → 3.0.0-beta.0

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/src/types.ts CHANGED
@@ -27,6 +27,7 @@ export type SourceToPermalink = {
27
27
  export type VersionTag = Tag & {
28
28
  /** All doc ids having this tag. */
29
29
  docIds: string[];
30
+ unlisted: boolean;
30
31
  };
31
32
  export type VersionTags = {
32
33
  [permalink: string]: VersionTag;
@@ -14,12 +14,16 @@ import {
14
14
  getVersionMetadataPaths,
15
15
  readVersionNames,
16
16
  } from './files';
17
+ import {createSidebarsUtils} from '../sidebars/utils';
18
+ import {getCategoryGeneratedIndexMetadataList} from '../categoryGeneratedIndex';
19
+ import type {FullVersion} from '../types';
20
+ import type {LoadContext} from '@docusaurus/types';
17
21
  import type {
22
+ LoadedVersion,
18
23
  PluginOptions,
19
24
  VersionBanner,
20
25
  VersionMetadata,
21
26
  } from '@docusaurus/plugin-content-docs';
22
- import type {LoadContext} from '@docusaurus/types';
23
27
 
24
28
  export type VersionContext = {
25
29
  /** The version name to get banner of. */
@@ -252,3 +256,15 @@ export async function readVersionsMetadata({
252
256
  );
253
257
  return versionsMetadata;
254
258
  }
259
+
260
+ export function toFullVersion(version: LoadedVersion): FullVersion {
261
+ const sidebarsUtils = createSidebarsUtils(version.sidebars);
262
+ return {
263
+ ...version,
264
+ sidebarsUtils,
265
+ categoryGeneratedIndices: getCategoryGeneratedIndexMetadataList({
266
+ docs: version.docs,
267
+ sidebarsUtils,
268
+ }),
269
+ };
270
+ }