starlight-cannoli-plugins 1.0.8 → 1.0.9

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.
@@ -1,12 +1,49 @@
1
1
  import { HookParameters } from '@astrojs/starlight/types';
2
2
 
3
+ /**
4
+ * Configuration options for sidebar generation behavior.
5
+ */
3
6
  type TOptions = {
7
+ /**
8
+ * Controls how deep the nested group structure can go, where the root directory is level 0.
9
+ * Once this depth is reached, no further child groups are created; instead, any index.md or index.mdx
10
+ * files found deeper in the subtree are flattened and included as slug items directly at the current level.
11
+ * @default 100
12
+ */
4
13
  maxDepthNesting?: number;
14
+ /**
15
+ * When true, all labels (both group labels and slug item labels) are derived from the raw directory name.
16
+ * When false, the label for a slug item is read from the title field in the index.md or index.mdx file's
17
+ * frontmatter; group labels are still derived from the raw directory name.
18
+ * @default true
19
+ */
5
20
  dirnameDeterminesLabels?: boolean;
6
21
  };
22
+ /**
23
+ * Options for the starlightIndexOnlySidebar plugin.
24
+ * Automatically generates a sidebar configuration by scanning for index.md/index.mdx files in specified directories.
25
+ */
7
26
  type TIndexOnlySidebarPluginOptions = TOptions & {
27
+ /**
28
+ * Array of directory names (relative to src/content/docs) to scan for sidebar generation.
29
+ * Each directory will become a top-level group in the sidebar.
30
+ * @example ["reference", "guides", "api-docs"]
31
+ */
8
32
  directories: string[];
9
33
  };
34
+ /**
35
+ * Starlight plugin that automatically generates a sidebar configuration by scanning the filesystem
36
+ * for index.md/index.mdx files in specified directories.
37
+ *
38
+ * @param pluginOptions - Configuration options for the sidebar generation
39
+ * @returns A Starlight plugin object
40
+ * @example
41
+ * starlightIndexOnlySidebar({
42
+ * maxDepthNesting: 1,
43
+ * dirnameDeterminesLabels: true,
44
+ * directories: ["reference", "guides"],
45
+ * })
46
+ */
10
47
  declare function starlightIndexOnlySidebar(pluginOptions: TIndexOnlySidebarPluginOptions): {
11
48
  name: string;
12
49
  hooks: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-cannoli-plugins",
3
3
  "type": "module",
4
- "version": "1.0.8",
4
+ "version": "1.0.9",
5
5
  "description": "Starlight plugins for automatic sidebar generation and link validation",
6
6
  "license": "ISC",
7
7
  "main": "./dist/index.js",