@sp-days-framework/docusaurus-plugin-slidev 1.1.0-beta2 → 1.1.0-beta3

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 (56) hide show
  1. package/docs/advanced-configuration.mdx +103 -24
  2. package/docs/changelog.mdx +52 -0
  3. package/docs/install.mdx +27 -18
  4. package/docs/slide-directory.mdx +184 -0
  5. package/docs/slidev-link.mdx +40 -0
  6. package/lib/plugin/builder.d.ts +9 -3
  7. package/lib/plugin/builder.d.ts.map +1 -1
  8. package/lib/plugin/builder.js +122 -39
  9. package/lib/plugin/builder.js.map +1 -1
  10. package/lib/plugin/index.d.ts.map +1 -1
  11. package/lib/plugin/index.js +108 -26
  12. package/lib/plugin/index.js.map +1 -1
  13. package/lib/plugin/scanner.d.ts +9 -2
  14. package/lib/plugin/scanner.d.ts.map +1 -1
  15. package/lib/plugin/scanner.js +180 -29
  16. package/lib/plugin/scanner.js.map +1 -1
  17. package/lib/theme/SlidevCard/index.d.ts.map +1 -1
  18. package/lib/theme/SlidevCard/index.js +1 -2
  19. package/lib/theme/SlidevCard/index.js.map +1 -1
  20. package/lib/theme/SlidevCard/styles.module.css +6 -2
  21. package/lib/theme/SlidevCategoryCard/index.d.ts +11 -0
  22. package/lib/theme/SlidevCategoryCard/index.d.ts.map +1 -0
  23. package/lib/theme/SlidevCategoryCard/index.js +31 -0
  24. package/lib/theme/SlidevCategoryCard/index.js.map +1 -0
  25. package/lib/theme/SlidevCategoryCard/styles.module.css +158 -0
  26. package/lib/theme/SlidevLink/index.d.ts +32 -0
  27. package/lib/theme/SlidevLink/index.d.ts.map +1 -0
  28. package/lib/theme/SlidevLink/index.js +139 -0
  29. package/lib/theme/SlidevLink/index.js.map +1 -0
  30. package/lib/theme/SlidevLink/styles.module.css +228 -0
  31. package/lib/theme/SlidevListItem/index.d.ts +18 -0
  32. package/lib/theme/SlidevListItem/index.d.ts.map +1 -0
  33. package/lib/theme/SlidevListItem/index.js +44 -0
  34. package/lib/theme/SlidevListItem/index.js.map +1 -0
  35. package/lib/theme/SlidevListItem/styles.module.css +128 -0
  36. package/lib/theme/SlidevOverview/index.d.ts +1 -0
  37. package/lib/theme/SlidevOverview/index.d.ts.map +1 -1
  38. package/lib/theme/SlidevOverview/index.js +156 -71
  39. package/lib/theme/SlidevOverview/index.js.map +1 -1
  40. package/lib/theme/SlidevOverview/styles.module.css +176 -147
  41. package/lib/types/index.d.ts +85 -6
  42. package/lib/types/index.d.ts.map +1 -1
  43. package/lib/utils/fileSystem.d.ts +53 -0
  44. package/lib/utils/fileSystem.d.ts.map +1 -1
  45. package/lib/utils/fileSystem.js +151 -0
  46. package/lib/utils/fileSystem.js.map +1 -1
  47. package/lib/utils/icons.d.ts +34 -0
  48. package/lib/utils/icons.d.ts.map +1 -1
  49. package/lib/utils/icons.js +60 -0
  50. package/lib/utils/icons.js.map +1 -1
  51. package/lib/utils/logger.d.ts +11 -2
  52. package/lib/utils/logger.d.ts.map +1 -1
  53. package/lib/utils/logger.js +64 -8
  54. package/lib/utils/logger.js.map +1 -1
  55. package/package.json +2 -1
  56. package/publish-package-docs.js +11 -3
@@ -12,18 +12,20 @@ import TabItem from "@theme/TabItem";
12
12
 
13
13
  ## All Plugin Options
14
14
 
15
- | Option | Type | Default | Description |
16
- | ----------------- | --------- | ------------------------------------- | ------------------------------------------------------------------ |
17
- | `sourceDir` | `string` | `'./slidev'` | Directory to scan for Slidev markdown files |
18
- | `outputDir` | `string` | `'slides'` | Output directory inside `static/` for built presentations |
19
- | `theme` | `string` | `undefined` | Global theme override for all presentations |
20
- | `download` | `boolean` | `false` | Enable PDF download functionality |
21
- | `overviewPath` | `string` | `'/slidev'` | URL path for the auto-generated overview page |
22
- | `overviewTitle` | `string` | `'Slidev Presentations'` | Custom title for the overview page |
23
- | `overviewTagline` | `string` | `'Interactive presentation overview'` | Custom tagline/description for the overview page |
24
- | `id` | `string` | `'default'` | Plugin ID for multiple instances |
25
- | `buildTimeout` | `number` | `60` | Timeout in seconds for building each presentation (10-600) |
26
- | `verbose` | `boolean` | `false` | Enable verbose logging for Slidev build output |
15
+ | Option | Type | Default | Description |
16
+ | ------------------- | --------- | ------------------------------------- | ---------------------------------------------------------------------- |
17
+ | `path` | `string` | `'./slidev'` | Directory to scan for Slidev markdown files (also determines URL path) |
18
+ | `theme` | `string` | `undefined` | Global theme override for all presentations |
19
+ | `download` | `boolean` | `false` | Enable PDF download functionality |
20
+ | `routeBasePath` | `string` | `'/slidev'` | URL path for the auto-generated overview page |
21
+ | `pageTitle` | `string` | `'Slidev Presentations'` | Custom title for the overview page |
22
+ | `pageTagline` | `string` | `'Interactive presentation overview'` | Custom tagline/description for the overview page |
23
+ | `id` | `string` | `'default'` | Plugin ID for multiple instances |
24
+ | `buildTimeout` | `number` | `120` | Timeout in seconds for building each presentation (10-600) |
25
+ | `maxParallelBuilds` | `number` | `4` | Maximum parallel Slidev builds (capped at CPU count) |
26
+ | `verbose` | `boolean` | `false` | Enable verbose logging for Slidev build output |
27
+
28
+
27
29
 
28
30
  ## All Frontmatter Options
29
31
 
@@ -35,6 +37,7 @@ Configure individual presentations using frontmatter:
35
37
  | `title` | `string` | Presentation title |
36
38
  | `description` | `string` | Brief description for overview page |
37
39
  | `author` | `string` | Author name(s) |
40
+ | `position` | `number` | Manual sort order (lower numbers appear first) |
38
41
  | `layout` | `string` | Layout for the slide (e.g., `cover`, `intro`) |
39
42
 
40
43
  See [Slidev documentation](https://sli.dev/guide/syntax.html#frontmatter) for all available frontmatter options.
@@ -45,31 +48,36 @@ Run multiple instances with different configurations:
45
48
 
46
49
  ```js title="docusaurus.config.js"
47
50
  module.exports = {
48
- staticDirectories: ["static"],
49
-
50
51
  plugins: [
51
52
  [
52
53
  "@sp-days-framework/docusaurus-plugin-slidev",
53
54
  {
54
55
  id: "workshops",
55
- sourceDir: "./slidev/workshops",
56
- overviewPath: "/workshops/slides",
57
- overviewTitle: "Workshop Presentations",
56
+ path: "./slidev/workshops",
57
+ routeBasePath: "/workshops",
58
+ pageTitle: "Workshop Presentations",
58
59
  },
59
60
  ],
60
61
  [
61
62
  "@sp-days-framework/docusaurus-plugin-slidev",
62
63
  {
63
64
  id: "training",
64
- sourceDir: "./slidev/training",
65
- overviewPath: "/training/slides",
66
- overviewTitle: "Training Materials",
65
+ path: "./slidev/training",
66
+ routeBasePath: "/training",
67
+ pageTitle: "Training Materials",
67
68
  },
68
69
  ],
69
70
  ],
70
71
  };
71
72
  ```
72
73
 
74
+ :::note
75
+ With multiple instances, the URL paths are derived from each `path`:
76
+
77
+ - `./slidev/workshops` → presentations served at `/workshops/`
78
+ - `./slidev/training` → presentations served at `/training/`
79
+ :::
80
+
73
81
  This allows you to organize different types of presentations separately.
74
82
 
75
83
  ## Global Theme Configuration
@@ -101,15 +109,42 @@ module.exports = {
101
109
  [
102
110
  "@sp-days-framework/docusaurus-plugin-slidev",
103
111
  {
104
- overviewPath: "/presentations",
105
- overviewTitle: "Our Presentations",
106
- overviewTagline: "Explore our collection of learning materials",
112
+ routeBasePath: "/presentations",
113
+ pageTitle: "Our Presentations",
114
+ pageTagline: "Explore our collection of learning materials",
115
+ },
116
+ ],
117
+ ],
118
+ };
119
+ ```
120
+
121
+ ## Parallel Builds
122
+
123
+ By default, presentations are built in parallel to significantly reduce build time. The plugin uses a worker pool pattern that dynamically allocates builds as slots become available.
124
+
125
+ ```js title="docusaurus.config.js"
126
+ module.exports = {
127
+ plugins: [
128
+ [
129
+ "@sp-days-framework/docusaurus-plugin-slidev",
130
+ {
131
+ maxParallelBuilds: 4, // Default: 4 (capped at CPU count)
107
132
  },
108
133
  ],
109
134
  ],
110
135
  };
111
136
  ```
112
137
 
138
+ :::tip[Resource-constrained environments]
139
+ For CI/CD runners with limited resources, you can reduce parallel builds:
140
+
141
+ ```js
142
+ maxParallelBuilds: 2; // Lower concurrency for limited resources
143
+ ```
144
+
145
+ Set to `1` for sequential builds (legacy behavior).
146
+ :::
147
+
113
148
  ## Build Timeout Configuration
114
149
 
115
150
  For large presentations, increase the build timeout:
@@ -121,7 +156,7 @@ module.exports = {
121
156
  "@sp-days-framework/docusaurus-plugin-slidev",
122
157
  {
123
158
  buildTimeout: 120, // 2 minutes per presentation
124
- verbose: true, // Enable verbose logging
159
+ verbose: true, // Enable verbose logging
125
160
  },
126
161
  ],
127
162
  ],
@@ -144,3 +179,47 @@ module.exports = {
144
179
  ],
145
180
  };
146
181
  ```
182
+
183
+ :::warning[Playwright Chromium Required]
184
+ PDF download requires `playwright-chromium` to be installed:
185
+
186
+ ```bash
187
+ npm install -D playwright-chromium
188
+ ```
189
+
190
+ This adds approximately **300MB** to your dependencies. Only enable this feature if you need PDF exports.
191
+ :::
192
+
193
+ ## Custom Sort Order
194
+
195
+ ### Using Filename Convention
196
+
197
+ By default, presentations are sorted by filename using natural sorting. This means files like `module-01.md`, `module-02.md`, ..., `module-10.md` will sort correctly (not as `01, 10, 02, 03...`).
198
+
199
+ ### Using Position Frontmatter
200
+
201
+ For manual control over sort order, use the `position` frontmatter field:
202
+
203
+ ```markdown title="slidev/introduction.md"
204
+ ---
205
+ title: Welcome Introduction
206
+ position: 1
207
+ ---
208
+
209
+ # Welcome!
210
+ ```
211
+
212
+ ```markdown title="slidev/advanced-topics.md"
213
+ ---
214
+ title: Advanced Topics
215
+ position: 2.5
216
+ ---
217
+
218
+ # Advanced Topics
219
+ ```
220
+
221
+ **Sort priority:**
222
+
223
+ 1. `position` (if specified) - lower numbers appear first
224
+ 2. `sourcePath` - natural filename sorting
225
+ 3. `title` - alphabetical fallback
@@ -19,6 +19,58 @@ All packages within `@sp-days-framework` use the same version number. In some ca
19
19
 
20
20
  ---
21
21
 
22
+ ## Version 1.1.0-beta3 ![beta](https://img.shields.io/badge/release-beta-yellow)
23
+
24
+ Bug fixes, improved build output, and new features including directory support for organizing presentations
25
+
26
+ <details>
27
+ <summary><strong>Beta Details</strong> (2025 December 12)</summary>
28
+
29
+ ### Bug Fixes
30
+
31
+ - **Grid View Sorting** - Fixed sorting to use natural sort on `sourcePath` instead of `title`, correctly handling numeric sequences like `module-01`, `module-02`, ..., `module-10`
32
+ - **Strict Theme Validation** - Changed from warning to error when theme is not installed, preventing build hangs
33
+ - **Build Output Filtering** - Suppressed verbose Vite/Slidev output including chunk manifests, transformation progress, and outDir warnings
34
+ - **Build Timeout** - Increased default timeout from 60s to 120s for large presentations
35
+
36
+ ### New Features
37
+
38
+ - **Hidden Build Output** - Presentations are now built to a hidden `.docusaurus` cache directory instead of `static/`, keeping the user's workspace clean. Build artifacts are automatically copied to the final output during the Docusaurus build process
39
+ - **Directory Support** - Organize presentations into directories with `_category_.yml`/`_category_.json` metadata files for better navigation and grouping. See [Slide Directory](./slide-directory.mdx) for details
40
+ - **Parallel Builds** - Added `maxParallelBuilds` option (default: 4) to build multiple presentations simultaneously, significantly reducing total build time
41
+ - **Position Frontmatter** - Added `position` field to manually control sort order (lower numbers first, supports decimals)
42
+ - **SlidevLink Component** - New embeddable component for displaying slide previews in MDX documentation
43
+ - **Renamed Options** - Updated option names to better match Docusaurus conventions
44
+
45
+ ### Breaking Changes
46
+
47
+ - **Removed `outputDir` option** - The URL path is now automatically derived from `path`. For example, `path: './slidev'` serves presentations at `/slidev/`. This simplifies configuration and eliminates the need for manual `.gitignore` entries for build artifacts
48
+
49
+ ### Deprecated Options
50
+
51
+ The following options have been renamed and will be removed in a future version:
52
+
53
+ | Deprecated Option | New Option | Notes |
54
+ | ------------------- | ---------------- | --------------------------------------------- |
55
+ | `sourceDir` | `path` | Matches Docusaurus plugin conventions |
56
+ | `overviewPath` | `routeBasePath` | Matches Docusaurus `docs` plugin naming |
57
+ | `overviewTitle` | `pageTitle` | More concise naming |
58
+ | `overviewTagline` | `pageTagline` | More concise naming |
59
+
60
+ The old options still work but will log a deprecation warning. Update your configuration to use the new names.
61
+
62
+ ### Improvements
63
+
64
+ - **Cleaner Workspace** - No more `static/slides/` directory cluttering your project
65
+ - **Faster Builds** - Parallel build support reduces build time by up to 4x on multi-core machines
66
+ - **Cleaner Build Output** - Build now shows only completion messages with timing (no Vite noise)
67
+ - **Natural Sorting** - File paths with numbers now sort correctly using `Intl.Collator`
68
+ - **Better Error Messages** - Theme not found errors now include installation command
69
+
70
+ </details>
71
+
72
+ ---
73
+
22
74
  ## Version 1.1.0-beta2 ![beta](https://img.shields.io/badge/release-beta-yellow)
23
75
 
24
76
  Documentation improvements and visual refinements
package/docs/install.mdx CHANGED
@@ -48,18 +48,12 @@ Install Slidev dependencies:
48
48
 
49
49
  Add the plugin to your `docusaurus.config.js`:
50
50
 
51
- ```js title="docusaurus.config.js" {2,4}
51
+ ```js title="docusaurus.config.js"
52
52
  module.exports = {
53
- staticDirectories: ["static"],
54
-
55
53
  plugins: ["@sp-days-framework/docusaurus-plugin-slidev"],
56
54
  };
57
55
  ```
58
56
 
59
- :::note
60
- The `static` directory is required for serving built presentations.
61
- :::
62
-
63
57
  **Optional:** Add the `slidev` script for live preview during development:
64
58
 
65
59
  ```json title="package.json" {4}
@@ -79,11 +73,27 @@ The plugin works with default settings:
79
73
 
80
74
  ```js title="docusaurus.config.js"
81
75
  module.exports = {
82
- staticDirectories: ["static"],
83
76
  plugins: ["@sp-days-framework/docusaurus-plugin-slidev"],
84
77
  };
85
78
  ```
86
79
 
80
+ ### Adding to Navbar
81
+
82
+ To add the Slidev overview page to your navbar, update your `docusaurus.config.js`:
83
+
84
+ ```js title="docusaurus.config.js"
85
+ module.exports = {
86
+ themeConfig: {
87
+ navbar: {
88
+ items: [
89
+ // ... other items
90
+ { to: "/slidev", label: "Slides", position: "left" },
91
+ ],
92
+ },
93
+ },
94
+ };
95
+ ```
96
+
87
97
  ### Plugin Options
88
98
 
89
99
  Customize the plugin behavior:
@@ -94,10 +104,9 @@ module.exports = {
94
104
  [
95
105
  "@sp-days-framework/docusaurus-plugin-slidev",
96
106
  {
97
- sourceDir: "./slidev",
98
- outputDir: "slides",
107
+ path: "./slidev",
99
108
  theme: "@sp-days-framework/slidev-theme-sykehuspartner",
100
- overviewPath: "/presentations",
109
+ routeBasePath: "/slidev",
101
110
  },
102
111
  ],
103
112
  ],
@@ -106,13 +115,13 @@ module.exports = {
106
115
 
107
116
  Common options:
108
117
 
109
- | Option | Type | Default | Description |
110
- | ----------------- | --------- | ------------------------------------- | ------------------------------------------------------------------ |
111
- | `sourceDir` | `string` | `'./slidev'` | Directory to scan for Slidev markdown files |
112
- | `outputDir` | `string` | `'slides'` | Output directory inside `static/` for built presentations |
113
- | `theme` | `string` | `undefined` | Global theme override for all presentations |
114
- | `overviewPath` | `string` | `'/slidev'` | URL path for the auto-generated overview page |
115
- | `overviewTitle` | `string` | `'Slidev Presentations'` | Title for the overview page |
118
+ | Option | Type | Default | Description |
119
+ | ------------------- | --------- | ------------------------------------- | ------------------------------------------------------------------- |
120
+ | `path` | `string` | `'./slidev'` | Directory for Slidev files (also determines URL path) |
121
+ | `theme` | `string` | `undefined` | Global theme override for all presentations |
122
+ | `routeBasePath` | `string` | `'/slidev'` | URL path for the auto-generated overview page |
123
+ | `pageTitle` | `string` | `'Slidev Presentations'` | Title for the overview page |
124
+ | `maxParallelBuilds` | `number` | `4` | Maximum parallel Slidev builds (capped at CPU count) |
116
125
 
117
126
  See [Advanced Configuration](./advanced-configuration.mdx) for all options.
118
127
 
@@ -0,0 +1,184 @@
1
+ ---
2
+ sidebar_position: 2.2
3
+ sidebar_label: "Slide Directory"
4
+ sidebar_custom_props:
5
+ section: "Features"
6
+ section_position: 2
7
+ ---
8
+
9
+ import Tabs from "@theme/Tabs";
10
+ import TabItem from "@theme/TabItem";
11
+
12
+ # Slide Directory
13
+
14
+ Organize your presentations into directories for better navigation and grouping. This is especially useful when you have many presentations that belong to different categories, modules, or topics.
15
+
16
+ ## Directory Structure
17
+
18
+ Create subdirectories within your `path` directory to group presentations:
19
+
20
+ ```
21
+ slidev/
22
+ ├── introduction.md # Root-level presentation
23
+ ├── getting-started.md # Root-level presentation
24
+ ├── advanced/ # Category directory
25
+ │ ├── _category_.yml # Category metadata (optional)
26
+ │ ├── networking.md
27
+ │ └── security.md
28
+ └── workshops/ # Another category
29
+ ├── _category_.yml
30
+ ├── hands-on-docker.md
31
+ └── kubernetes-basics.md
32
+ ```
33
+
34
+ ## Category Metadata
35
+
36
+ Configure category appearance using `_category_.yml` or `_category_.json`:
37
+
38
+ <Tabs>
39
+ <TabItem value="yaml" label="YAML" default>
40
+ ```yaml title="slidev/advanced/_category_.yml"
41
+ label: "Advanced Topics"
42
+ description: "Deep dives into complex subjects"
43
+ position: 2
44
+ ```
45
+ </TabItem>
46
+ <TabItem value="json" label="JSON">
47
+ ```json title="slidev/advanced/_category_.json"
48
+ {
49
+ "label": "Advanced Topics",
50
+ "description": "Deep dives into complex subjects",
51
+ "position": 2
52
+ }
53
+ ```
54
+ </TabItem>
55
+ </Tabs>
56
+
57
+ | Field | Type | Default | Description |
58
+ | ------------- | -------- | -------------- | ------------------------------------------------ |
59
+ | `label` | `string` | Directory name | Display name shown in overview |
60
+ | `description` | `string` | `undefined` | Brief description shown in category card/listing |
61
+ | `position` | `number` | `99` | Sort order (lower numbers appear first) |
62
+
63
+ :::tip[No metadata file?]
64
+ If you don't create a `_category_.yml` file, the directory name will be used as the label (converted to title case: `my-category` → `My Category`).
65
+ :::
66
+
67
+ ## Overview Navigation
68
+
69
+ The overview page adapts to show directory content:
70
+
71
+ ### Root Level View
72
+
73
+ Shows:
74
+
75
+ - All root-level presentations
76
+ - Category folders as clickable cards
77
+
78
+ ### Category View
79
+
80
+ When clicking a category folder:
81
+
82
+ - Shows presentations within that category
83
+ - Displays a back button to return to parent
84
+ - Category label and description replace the default title
85
+
86
+ ## URL Structure
87
+
88
+ Presentations in directories have paths that reflect their location:
89
+
90
+ | File Path | Presentation URL |
91
+ | ------------------------------- | ------------------------------ |
92
+ | `slidev/intro.md` | `/slides/intro/` |
93
+ | `slidev/advanced/networking.md` | `/slides/advanced/networking/` |
94
+ | `slidev/workshops/docker.md` | `/slides/workshops/docker/` |
95
+
96
+ Category overview pages are accessible at:
97
+
98
+ | Category Path | Overview URL |
99
+ | ------------- | ------------------- |
100
+ | Root | `/slidev` |
101
+ | `advanced` | `/slidev/advanced` |
102
+ | `workshops` | `/slidev/workshops` |
103
+
104
+ ## Grid vs List View
105
+
106
+ Both views support directory navigation:
107
+
108
+ ### Grid View
109
+
110
+ - Categories appear as folder cards with an icon
111
+ - Shows category label, description, and presentation count
112
+ - Click to navigate into the category
113
+
114
+ ### List View
115
+
116
+ - Categories appear as rows with folder icon prefix
117
+ - Compact display with label, description, and count
118
+ - Same click-to-navigate behavior
119
+
120
+ ## Nested Directories
121
+
122
+ You can nest directories multiple levels deep:
123
+
124
+ ```
125
+ slidev/
126
+ └── training/
127
+ ├── _category_.yml
128
+ ├── beginner/
129
+ │ ├── _category_.yml
130
+ │ └── basics.md
131
+ └── advanced/
132
+ ├── _category_.yml
133
+ └── expert-tips.md
134
+ ```
135
+
136
+ The back button always navigates to the parent level, allowing easy traversal through nested structures.
137
+
138
+ ## Sorting Within Categories
139
+
140
+ Presentations within a category follow the same sorting rules:
141
+
142
+ 1. `position` frontmatter (if specified)
143
+ 2. `sourcePath` (natural filename sorting)
144
+ 3. `title` (alphabetical fallback)
145
+
146
+ Categories themselves are sorted by their `position` field, then by label.
147
+
148
+ ## Example Configuration
149
+
150
+ ```yaml title="slidev/modules/_category_.yml"
151
+ label: "Course Modules"
152
+ description: "Step-by-step learning path for the complete course"
153
+ position: 1
154
+ ```
155
+
156
+ ```markdown title="slidev/modules/module-01-intro.md"
157
+ ---
158
+ title: "Module 1: Introduction"
159
+ description: "Getting started with the fundamentals"
160
+ position: 1
161
+ ---
162
+
163
+ # Introduction
164
+
165
+ Welcome to Module 1!
166
+ ```
167
+
168
+ ```markdown title="slidev/modules/module-02-basics.md"
169
+ ---
170
+ title: "Module 2: Core Concepts"
171
+ description: "Understanding the building blocks"
172
+ position: 2
173
+ ---
174
+
175
+ # Core Concepts
176
+
177
+ Let's explore the basics...
178
+ ```
179
+
180
+ ## Backward Compatibility
181
+
182
+ - **Flat structures still work** - If you don't use directories, everything works as before
183
+ - **Mixed structures supported** - You can have both root-level files and directories
184
+ - **No configuration required** - Directory support is automatic
@@ -0,0 +1,40 @@
1
+ ---
2
+ sidebar_position: 2.1
3
+ sidebar_label: "Slidev Link"
4
+ sidebar_custom_props:
5
+ section: "Features"
6
+ section_position: 2
7
+ ---
8
+
9
+ import SlidevLink from "@theme/SlidevLink";
10
+
11
+ # Slidev Link Component
12
+
13
+ Embed slide previews directly in your MDX documentation:
14
+
15
+ <SlidevLink link="/slidev/creating-your-first-slidev" />
16
+
17
+ ## Example Usage
18
+
19
+ ```mdx
20
+ import SlidevLink from "@theme/SlidevLink";
21
+
22
+ # Module 1: Introduction
23
+
24
+ Before starting this module, review the presentation:
25
+
26
+ <SlidevLink link="/slidev/module-01" />
27
+ ```
28
+
29
+ ### Props
30
+
31
+ | Prop | Type | Default | Description |
32
+ | ---------- | -------- | ----------- | ----------------------------------- |
33
+ | `link` | `string` | _required_ | URL path to the presentation |
34
+ | `width` | `string` | `'550px'` | Card width |
35
+ | `pluginId` | `string` | `'default'` | Plugin ID for multi-instance setups |
36
+
37
+
38
+ ## Error Handling
39
+
40
+ If the presentation URL doesn't exist, the component displays an error state with the invalid path, making it easy to identify broken links during development.
@@ -4,17 +4,23 @@
4
4
  import type { PresentationMetadata, PluginOptions, BuildResult } from "../types";
5
5
  /**
6
6
  * Builds a single Slidev presentation with real-time output streaming
7
+ * Uses isolated build directories to prevent race conditions during parallel builds
7
8
  */
8
9
  /**
9
10
  * Builds a single Slidev presentation with real-time output streaming
11
+ * Uses isolated build directories to prevent race conditions during parallel builds
10
12
  */
11
13
  export declare function buildPresentation(presentation: PresentationMetadata, options: PluginOptions, context: {
12
14
  siteDir: string;
13
15
  baseUrl: string;
14
- }): Promise<BuildResult>;
16
+ }, cacheDir?: string): Promise<BuildResult>;
15
17
  /**
16
- * Builds all presentations sequentially
17
- * Returns array of build results
18
+ * Builds all presentations with parallel execution using a worker pool pattern.
19
+ * Uses dynamic slot allocation - as soon as a build completes, a new one starts.
20
+ * This is more efficient than batch processing when build times vary.
21
+ *
22
+ * Each presentation is built in an isolated directory within .docusaurus
23
+ * to prevent race conditions from Slidev creating index.html in the source directory.
18
24
  */
19
25
  export declare function buildAllPresentations(presentations: PresentationMetadata[], options: PluginOptions, context: {
20
26
  siteDir: string;
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/plugin/builder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,WAAW,EACZ,MAAM,UAAU,CAAC;AAoHlB;;GAEG;AACH;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,oBAAoB,EAClC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC5C,OAAO,CAAC,WAAW,CAAC,CAwPtB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,oBAAoB,EAAE,EACrC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC5C,OAAO,CAAC,WAAW,EAAE,CAAC,CA8CxB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAU7D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,oBAAoB,EAClC,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,EAAE,CAuGV"}
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/plugin/builder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,WAAW,EACZ,MAAM,UAAU,CAAC;AAqIlB;;;GAGG;AACH;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,oBAAoB,EAClC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC7C,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,CA2QtB;AAeD;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,oBAAoB,EAAE,EACrC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC5C,OAAO,CAAC,WAAW,EAAE,CAAC,CA2FxB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAU7D;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,oBAAoB,EAClC,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,EAAE,CAuGV"}