@sp-days-framework/docusaurus-plugin-slidev 1.1.0-beta2 → 1.1.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/docs/advanced-configuration.mdx +103 -24
- package/docs/changelog.mdx +41 -9
- package/docs/install.mdx +28 -19
- package/docs/slide-directory.mdx +184 -0
- package/docs/slidev-link.mdx +40 -0
- package/lib/plugin/builder.d.ts +9 -3
- package/lib/plugin/builder.d.ts.map +1 -1
- package/lib/plugin/builder.js +130 -39
- package/lib/plugin/builder.js.map +1 -1
- package/lib/plugin/index.d.ts.map +1 -1
- package/lib/plugin/index.js +108 -26
- package/lib/plugin/index.js.map +1 -1
- package/lib/plugin/scanner.d.ts +9 -2
- package/lib/plugin/scanner.d.ts.map +1 -1
- package/lib/plugin/scanner.js +180 -29
- package/lib/plugin/scanner.js.map +1 -1
- package/lib/theme/SlidevCard/index.d.ts.map +1 -1
- package/lib/theme/SlidevCard/index.js +1 -2
- package/lib/theme/SlidevCard/index.js.map +1 -1
- package/lib/theme/SlidevCard/styles.module.css +6 -2
- package/lib/theme/SlidevCategoryCard/index.d.ts +11 -0
- package/lib/theme/SlidevCategoryCard/index.d.ts.map +1 -0
- package/lib/theme/SlidevCategoryCard/index.js +31 -0
- package/lib/theme/SlidevCategoryCard/index.js.map +1 -0
- package/lib/theme/SlidevCategoryCard/styles.module.css +158 -0
- package/lib/theme/SlidevLink/index.d.ts +32 -0
- package/lib/theme/SlidevLink/index.d.ts.map +1 -0
- package/lib/theme/SlidevLink/index.js +139 -0
- package/lib/theme/SlidevLink/index.js.map +1 -0
- package/lib/theme/SlidevLink/styles.module.css +228 -0
- package/lib/theme/SlidevListItem/index.d.ts +18 -0
- package/lib/theme/SlidevListItem/index.d.ts.map +1 -0
- package/lib/theme/SlidevListItem/index.js +44 -0
- package/lib/theme/SlidevListItem/index.js.map +1 -0
- package/lib/theme/SlidevListItem/styles.module.css +128 -0
- package/lib/theme/SlidevOverview/index.d.ts +1 -0
- package/lib/theme/SlidevOverview/index.d.ts.map +1 -1
- package/lib/theme/SlidevOverview/index.js +156 -71
- package/lib/theme/SlidevOverview/index.js.map +1 -1
- package/lib/theme/SlidevOverview/styles.module.css +176 -147
- package/lib/types/index.d.ts +85 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/utils/fileSystem.d.ts +53 -0
- package/lib/utils/fileSystem.d.ts.map +1 -1
- package/lib/utils/fileSystem.js +151 -0
- package/lib/utils/fileSystem.js.map +1 -1
- package/lib/utils/icons.d.ts +34 -0
- package/lib/utils/icons.d.ts.map +1 -1
- package/lib/utils/icons.js +60 -0
- package/lib/utils/icons.js.map +1 -1
- package/lib/utils/logger.d.ts +11 -2
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +64 -8
- package/lib/utils/logger.js.map +1 -1
- package/package.json +2 -1
- package/publish-package-docs.js +11 -3
|
@@ -1,90 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SlidevOverview styles
|
|
3
|
+
* Layout with fixed-size banner and content containers
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* Main container - centers everything */
|
|
1
7
|
.container {
|
|
2
|
-
max-width: 1500px;
|
|
3
|
-
margin: 0 auto;
|
|
4
|
-
padding: 2rem;
|
|
5
|
-
position: relative;
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-direction: column;
|
|
8
10
|
align-items: center;
|
|
11
|
+
padding: 2rem;
|
|
12
|
+
min-height: calc(100vh - var(--ifm-navbar-height));
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
/* ============================================
|
|
16
|
+
Banner Section - Fixed width container
|
|
17
|
+
============================================ */
|
|
18
|
+
.bannerWrapper {
|
|
19
|
+
position: relative;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
13
23
|
width: 100%;
|
|
24
|
+
max-width: 1200px;
|
|
25
|
+
margin-bottom: 2rem;
|
|
14
26
|
}
|
|
15
27
|
|
|
16
|
-
.
|
|
28
|
+
.banner {
|
|
29
|
+
width: 100%;
|
|
30
|
+
max-width: 800px;
|
|
17
31
|
text-align: center;
|
|
32
|
+
padding: 0 1rem;
|
|
18
33
|
}
|
|
19
34
|
|
|
20
35
|
.title {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
gap: 0.75rem;
|
|
21
40
|
font-size: 2.5rem;
|
|
22
41
|
font-weight: 700;
|
|
23
42
|
color: var(--ifm-heading-color);
|
|
24
|
-
margin
|
|
43
|
+
margin: 0 0 0.75rem 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.titleIcon {
|
|
47
|
+
color: var(--ifm-color-primary);
|
|
48
|
+
flex-shrink: 0;
|
|
25
49
|
}
|
|
26
50
|
|
|
27
51
|
.subtitle {
|
|
28
52
|
font-size: 1.15rem;
|
|
29
53
|
color: var(--ifm-color-emphasis-700);
|
|
54
|
+
margin: 0;
|
|
30
55
|
max-width: 600px;
|
|
31
|
-
margin:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
margin-left: auto;
|
|
57
|
+
margin-right: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Back button - positioned absolutely to left of banner */
|
|
61
|
+
.backButton {
|
|
62
|
+
position: absolute;
|
|
63
|
+
left: 0;
|
|
64
|
+
top: 50%;
|
|
65
|
+
transform: translateY(-50%);
|
|
66
|
+
width: 48px;
|
|
67
|
+
height: 48px;
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
border: 2px solid var(--ifm-color-emphasis-300);
|
|
70
|
+
background: var(--ifm-background-color);
|
|
71
|
+
color: var(--ifm-color-emphasis-700);
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
transition: all 0.2s ease;
|
|
43
74
|
display: flex;
|
|
44
75
|
align-items: center;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
color: var(--ifm-color-warning-darkest);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.warningIcon {
|
|
52
|
-
width: 24px;
|
|
53
|
-
height: 24px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.warningText {
|
|
57
|
-
margin: 0;
|
|
58
|
-
color: var(--ifm-color-warning-contrast-foreground);
|
|
59
|
-
line-height: 1.6;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
78
|
+
text-decoration: none;
|
|
60
79
|
}
|
|
61
80
|
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
81
|
+
.backButton:hover {
|
|
82
|
+
border-color: var(--ifm-color-primary-contrast-background);
|
|
83
|
+
color: var(--ifm-color-primary-contrast-background);
|
|
84
|
+
background: var(--ifm-color-primary-lightest);
|
|
85
|
+
transform: translateY(-50%) scale(1.05);
|
|
86
|
+
text-decoration: none;
|
|
66
87
|
}
|
|
67
88
|
|
|
68
|
-
/*
|
|
69
|
-
display: inline-block;
|
|
70
|
-
padding: 0.2rem 0.5rem;
|
|
71
|
-
margin: 0 0.25rem;
|
|
72
|
-
background: var(--ifm-code-background);
|
|
73
|
-
border-radius: 4px;
|
|
74
|
-
font-family: var(--ifm-font-family-monospace);
|
|
75
|
-
font-size: 0.9rem;
|
|
76
|
-
color: var(--ifm-color-warning-contrast-background);
|
|
77
|
-
} */
|
|
78
|
-
|
|
79
|
-
/* Controls (Sort and View Toggle) - Fixed to top-right of viewport */
|
|
89
|
+
/* Controls - positioned absolutely to right of banner */
|
|
80
90
|
.controls {
|
|
81
|
-
position:
|
|
82
|
-
|
|
83
|
-
|
|
91
|
+
position: absolute;
|
|
92
|
+
right: 0;
|
|
93
|
+
top: 50%;
|
|
94
|
+
transform: translateY(-50%);
|
|
84
95
|
display: flex;
|
|
85
96
|
gap: 0.5rem;
|
|
86
97
|
align-items: center;
|
|
87
|
-
z-index: 100;
|
|
88
98
|
background: var(--ifm-background-color);
|
|
89
99
|
padding: 0.5rem;
|
|
90
100
|
border-radius: 8px;
|
|
@@ -105,102 +115,87 @@
|
|
|
105
115
|
}
|
|
106
116
|
|
|
107
117
|
.controlButton:hover {
|
|
108
|
-
border-color: var(--ifm-color-primary);
|
|
118
|
+
border-color: var(--ifm-color-primary-contrast-background);
|
|
109
119
|
color: var(--ifm-color-primary-contrast-background);
|
|
110
120
|
background: var(--ifm-color-primary-lightest);
|
|
111
121
|
}
|
|
112
122
|
|
|
113
|
-
/*
|
|
114
|
-
|
|
123
|
+
/* ============================================
|
|
124
|
+
Dev Mode Warning
|
|
125
|
+
============================================ */
|
|
126
|
+
.devModeWarning {
|
|
115
127
|
width: 100%;
|
|
116
|
-
max-width:
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* Visibility toggle classes */
|
|
121
|
-
|
|
122
|
-
.grid.hidden {
|
|
123
|
-
/* Keep in DOM but hidden - preserves iframe state */
|
|
124
|
-
display: none;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/* Grid View */
|
|
128
|
-
.grid {
|
|
129
|
-
display: flex;
|
|
130
|
-
flex-wrap: wrap;
|
|
131
|
-
justify-content: center;
|
|
132
|
-
gap: 1.5rem;
|
|
133
|
-
margin-bottom: 2rem;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* Details View (Table) */
|
|
137
|
-
.detailsTable {
|
|
128
|
+
max-width: 1200px;
|
|
129
|
+
padding: 1.5rem;
|
|
138
130
|
margin-bottom: 2rem;
|
|
139
|
-
overflow-x: auto;
|
|
140
|
-
width: 100%;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.detailsTable.hidden {
|
|
144
|
-
/* Keep in DOM but hidden */
|
|
145
|
-
display: none;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.detailsTable table {
|
|
149
|
-
display: table;
|
|
150
|
-
border-collapse: collapse;
|
|
151
|
-
background: var(--ifm-background-surface-color);
|
|
152
131
|
border-radius: 8px;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
.detailsTable thead {
|
|
157
|
-
background: var(--ifm-color-emphasis-100);
|
|
132
|
+
background: var(--ifm-color-warning-contrast-background);
|
|
133
|
+
border-left: 4px solid var(--ifm-color-warning);
|
|
158
134
|
}
|
|
159
135
|
|
|
160
|
-
.
|
|
161
|
-
|
|
162
|
-
|
|
136
|
+
.warningTitle {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
gap: 0.5rem;
|
|
140
|
+
margin-bottom: 0.5rem;
|
|
163
141
|
font-weight: 600;
|
|
164
|
-
color: var(--ifm-color-
|
|
165
|
-
font-size: 0.9rem;
|
|
166
|
-
border-bottom: 2px solid var(--ifm-color-emphasis-200);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.detailsTable td {
|
|
170
|
-
padding: 1rem;
|
|
171
|
-
border-bottom: 1px solid var(--ifm-color-emphasis-200);
|
|
172
|
-
font-size: 0.9rem;
|
|
142
|
+
color: var(--ifm-color-warning-darkest);
|
|
173
143
|
}
|
|
174
144
|
|
|
175
|
-
.
|
|
176
|
-
|
|
145
|
+
.warningIcon {
|
|
146
|
+
width: 24px;
|
|
147
|
+
height: 24px;
|
|
177
148
|
}
|
|
178
149
|
|
|
179
|
-
.
|
|
180
|
-
|
|
150
|
+
.warningText {
|
|
151
|
+
margin: 0;
|
|
152
|
+
color: var(--ifm-color-warning-contrast-foreground);
|
|
153
|
+
line-height: 1.6;
|
|
181
154
|
}
|
|
182
155
|
|
|
183
|
-
.
|
|
184
|
-
|
|
185
|
-
|
|
156
|
+
.warningText code {
|
|
157
|
+
display: inline-block;
|
|
158
|
+
padding: 0.2rem 0.5rem;
|
|
159
|
+
margin: 0 0.25rem;
|
|
160
|
+
background: var(--ifm-code-background);
|
|
161
|
+
border-radius: 4px;
|
|
162
|
+
font-family: var(--ifm-font-family-monospace);
|
|
163
|
+
font-size: 0.9rem;
|
|
186
164
|
}
|
|
187
165
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
166
|
+
/* ============================================
|
|
167
|
+
Content Container - Fixed width
|
|
168
|
+
============================================ */
|
|
169
|
+
.contentContainer {
|
|
170
|
+
width: 100%;
|
|
171
|
+
max-width: 1200px;
|
|
172
|
+
min-height: 400px;
|
|
192
173
|
}
|
|
193
174
|
|
|
194
|
-
|
|
195
|
-
|
|
175
|
+
/* Grid View - items wrap and fill available space */
|
|
176
|
+
.grid {
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-wrap: wrap;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
gap: 1.5rem;
|
|
196
181
|
}
|
|
197
182
|
|
|
198
|
-
|
|
199
|
-
|
|
183
|
+
/* List View - full width items */
|
|
184
|
+
.list {
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
gap: 0.5rem;
|
|
188
|
+
width: 100%;
|
|
200
189
|
}
|
|
201
190
|
|
|
202
|
-
/*
|
|
191
|
+
/* ============================================
|
|
192
|
+
Empty State
|
|
193
|
+
============================================ */
|
|
203
194
|
.emptyState {
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-direction: column;
|
|
197
|
+
align-items: center;
|
|
198
|
+
justify-content: center;
|
|
204
199
|
text-align: center;
|
|
205
200
|
padding: 4rem 2rem;
|
|
206
201
|
color: var(--ifm-color-emphasis-600);
|
|
@@ -209,7 +204,7 @@
|
|
|
209
204
|
.emptyStateIcon {
|
|
210
205
|
width: 64px;
|
|
211
206
|
height: 64px;
|
|
212
|
-
margin:
|
|
207
|
+
margin-bottom: 1rem;
|
|
213
208
|
opacity: 0.5;
|
|
214
209
|
}
|
|
215
210
|
|
|
@@ -235,49 +230,83 @@
|
|
|
235
230
|
color: var(--ifm-color-emphasis-900);
|
|
236
231
|
}
|
|
237
232
|
|
|
233
|
+
/* ============================================
|
|
234
|
+
Responsive Styles
|
|
235
|
+
============================================ */
|
|
236
|
+
@media (max-width: 992px) {
|
|
237
|
+
.bannerWrapper {
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
gap: 1rem;
|
|
240
|
+
padding: 0 60px; /* Space for side buttons */
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.backButton {
|
|
244
|
+
position: absolute;
|
|
245
|
+
left: 50px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.controls {
|
|
249
|
+
position: absolute;
|
|
250
|
+
right: 50px;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
238
254
|
@media (max-width: 768px) {
|
|
239
255
|
.container {
|
|
240
256
|
padding: 1rem;
|
|
241
257
|
}
|
|
242
258
|
|
|
259
|
+
.bannerWrapper {
|
|
260
|
+
flex-direction: column;
|
|
261
|
+
gap: 1rem;
|
|
262
|
+
padding: 0;
|
|
263
|
+
position: relative;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.banner {
|
|
267
|
+
padding: 0;
|
|
268
|
+
order: 2;
|
|
269
|
+
}
|
|
270
|
+
|
|
243
271
|
.title {
|
|
244
|
-
font-size:
|
|
272
|
+
font-size: 1.75rem;
|
|
245
273
|
}
|
|
246
274
|
|
|
247
275
|
.subtitle {
|
|
248
276
|
font-size: 1rem;
|
|
249
277
|
}
|
|
250
278
|
|
|
251
|
-
.
|
|
252
|
-
|
|
253
|
-
|
|
279
|
+
.backButton {
|
|
280
|
+
position: relative;
|
|
281
|
+
top: auto;
|
|
282
|
+
left: auto;
|
|
283
|
+
transform: none;
|
|
284
|
+
order: 1;
|
|
285
|
+
align-self: flex-start;
|
|
254
286
|
}
|
|
255
287
|
|
|
256
|
-
.
|
|
257
|
-
|
|
288
|
+
.backButton:hover {
|
|
289
|
+
transform: scale(1.05);
|
|
258
290
|
}
|
|
259
291
|
|
|
260
292
|
.controls {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
293
|
+
position: relative;
|
|
294
|
+
top: auto;
|
|
295
|
+
right: auto;
|
|
296
|
+
transform: none;
|
|
297
|
+
order: 3;
|
|
298
|
+
align-self: center;
|
|
264
299
|
}
|
|
265
300
|
|
|
266
|
-
.
|
|
267
|
-
|
|
301
|
+
.devModeWarning {
|
|
302
|
+
padding: 1rem;
|
|
268
303
|
}
|
|
269
304
|
|
|
270
305
|
.grid {
|
|
271
|
-
|
|
272
|
-
align-items: center;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.detailsTable {
|
|
276
|
-
font-size: 0.85rem;
|
|
306
|
+
gap: 1rem;
|
|
277
307
|
}
|
|
278
308
|
|
|
279
|
-
.
|
|
280
|
-
|
|
281
|
-
padding: 0.75rem 0.5rem;
|
|
309
|
+
.contentContainer {
|
|
310
|
+
min-height: 200px;
|
|
282
311
|
}
|
|
283
312
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -7,14 +7,16 @@
|
|
|
7
7
|
export interface PluginOptions {
|
|
8
8
|
/**
|
|
9
9
|
* Directory to scan for Slidev markdown files
|
|
10
|
+
* Also determines the URL path where presentations are served
|
|
11
|
+
* e.g., './slidev' -> '/slidev/', './presentations' -> '/presentations/'
|
|
10
12
|
* @default './slidev'
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
path: string;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
+
* @deprecated Use `path` instead. Will be removed in a future version.
|
|
17
|
+
* Alias for `path` - directory to scan for Slidev markdown files
|
|
16
18
|
*/
|
|
17
|
-
|
|
19
|
+
sourceDir?: string;
|
|
18
20
|
/**
|
|
19
21
|
* Global theme override for all presentations
|
|
20
22
|
* Example: '@slidev/theme-seriph'
|
|
@@ -29,18 +31,34 @@ export interface PluginOptions {
|
|
|
29
31
|
download: boolean;
|
|
30
32
|
/**
|
|
31
33
|
* URL path for the auto-generated overview page
|
|
34
|
+
* Matches Docusaurus convention for route configuration
|
|
32
35
|
* @default '/slidev'
|
|
33
36
|
*/
|
|
34
|
-
|
|
37
|
+
routeBasePath: string;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `routeBasePath` instead. Will be removed in a future version.
|
|
40
|
+
* Alias for `routeBasePath`
|
|
41
|
+
*/
|
|
42
|
+
overviewPath?: string;
|
|
35
43
|
/**
|
|
36
44
|
* Custom title for the overview page
|
|
37
45
|
* @default 'Slidev Presentations'
|
|
38
46
|
*/
|
|
47
|
+
pageTitle?: string;
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Use `pageTitle` instead. Will be removed in a future version.
|
|
50
|
+
* Alias for `pageTitle`
|
|
51
|
+
*/
|
|
39
52
|
overviewTitle?: string;
|
|
40
53
|
/**
|
|
41
54
|
* Custom tagline/description for the overview page
|
|
42
55
|
* @default 'Interactive presentation overview'
|
|
43
56
|
*/
|
|
57
|
+
pageTagline?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `pageTagline` instead. Will be removed in a future version.
|
|
60
|
+
* Alias for `pageTagline`
|
|
61
|
+
*/
|
|
44
62
|
overviewTagline?: string;
|
|
45
63
|
/**
|
|
46
64
|
* Plugin ID for multiple instances
|
|
@@ -50,7 +68,7 @@ export interface PluginOptions {
|
|
|
50
68
|
/**
|
|
51
69
|
* Timeout in seconds for building each presentation
|
|
52
70
|
* If a build takes longer than this, it will be terminated
|
|
53
|
-
* @default
|
|
71
|
+
* @default 120
|
|
54
72
|
*/
|
|
55
73
|
buildTimeout?: number;
|
|
56
74
|
/**
|
|
@@ -59,6 +77,13 @@ export interface PluginOptions {
|
|
|
59
77
|
* @default false
|
|
60
78
|
*/
|
|
61
79
|
verbose?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Maximum number of parallel Slidev builds
|
|
82
|
+
* Higher values speed up builds but use more system resources
|
|
83
|
+
* Set to 1 for sequential builds (legacy behavior)
|
|
84
|
+
* @default 4 (capped at CPU count)
|
|
85
|
+
*/
|
|
86
|
+
maxParallelBuilds?: number;
|
|
62
87
|
}
|
|
63
88
|
/**
|
|
64
89
|
* Metadata extracted from a Slidev presentation
|
|
@@ -108,6 +133,17 @@ export interface PresentationMetadata {
|
|
|
108
133
|
* Example: '/slides/module-01-slides/preview.html'
|
|
109
134
|
*/
|
|
110
135
|
previewUrl?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Manual sort position override from frontmatter
|
|
138
|
+
* If not specified, sorting falls back to sourcePath then title
|
|
139
|
+
*/
|
|
140
|
+
position?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Category path if presentation is inside a directory
|
|
143
|
+
* Empty string for root-level presentations
|
|
144
|
+
* Example: 'advanced' or 'workshops/intro'
|
|
145
|
+
*/
|
|
146
|
+
category?: string;
|
|
111
147
|
}
|
|
112
148
|
/**
|
|
113
149
|
* Slidev frontmatter configuration
|
|
@@ -122,6 +158,12 @@ export interface SlidevFrontmatter {
|
|
|
122
158
|
transition?: string;
|
|
123
159
|
background?: string;
|
|
124
160
|
class?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Manual sort position override
|
|
163
|
+
* Lower numbers appear first in the overview
|
|
164
|
+
* Supports decimals for fine-grained ordering (e.g., 2.5)
|
|
165
|
+
*/
|
|
166
|
+
position?: number;
|
|
125
167
|
fonts?: {
|
|
126
168
|
sans?: string;
|
|
127
169
|
serif?: string;
|
|
@@ -129,6 +171,39 @@ export interface SlidevFrontmatter {
|
|
|
129
171
|
};
|
|
130
172
|
[key: string]: any;
|
|
131
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Category metadata from _category_.yml or _category_.json files
|
|
176
|
+
* Used to configure directory groupings in the overview
|
|
177
|
+
*/
|
|
178
|
+
export interface CategoryMetadata {
|
|
179
|
+
/**
|
|
180
|
+
* Directory path relative to sourceDir (e.g., 'advanced', 'workshops/intro')
|
|
181
|
+
*/
|
|
182
|
+
path: string;
|
|
183
|
+
/**
|
|
184
|
+
* Display name for the category
|
|
185
|
+
* Falls back to directory name if not specified
|
|
186
|
+
*/
|
|
187
|
+
label: string;
|
|
188
|
+
/**
|
|
189
|
+
* Description shown in the category card/header
|
|
190
|
+
*/
|
|
191
|
+
description?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Sort position for the category
|
|
194
|
+
* Lower numbers appear first
|
|
195
|
+
* @default 99
|
|
196
|
+
*/
|
|
197
|
+
position: number;
|
|
198
|
+
/**
|
|
199
|
+
* Number of presentations in this category
|
|
200
|
+
*/
|
|
201
|
+
count: number;
|
|
202
|
+
/**
|
|
203
|
+
* URL path to navigate to this category's view
|
|
204
|
+
*/
|
|
205
|
+
url: string;
|
|
206
|
+
}
|
|
132
207
|
/**
|
|
133
208
|
* Build result for a single presentation
|
|
134
209
|
*/
|
|
@@ -159,6 +234,10 @@ export interface PluginContentData {
|
|
|
159
234
|
* List of all discovered presentations
|
|
160
235
|
*/
|
|
161
236
|
presentations: PresentationMetadata[];
|
|
237
|
+
/**
|
|
238
|
+
* List of all discovered categories (directories with presentations)
|
|
239
|
+
*/
|
|
240
|
+
categories: CategoryMetadata[];
|
|
162
241
|
/**
|
|
163
242
|
* Plugin configuration
|
|
164
243
|
*/
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IAC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AO,CAAC;CAChB"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* File system utilities for Slidev Plugin
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* The cache directory name within .docusaurus
|
|
6
|
+
*/
|
|
7
|
+
export declare const SLIDEV_CACHE_DIR = "docusaurus-plugin-slidev";
|
|
4
8
|
/**
|
|
5
9
|
* Cleans up the output directory before building presentations
|
|
6
10
|
* Removes all subdirectories and files but preserves .gitignore
|
|
@@ -16,4 +20,53 @@ export declare function cleanupSourceDirectory(sourcePath: string): void;
|
|
|
16
20
|
* Content: ignore all files except .gitignore itself
|
|
17
21
|
*/
|
|
18
22
|
export declare function createGitignore(outputPath: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the Slidev cache directory path within .docusaurus
|
|
25
|
+
* This is used to isolate builds and prevent race conditions
|
|
26
|
+
* @param siteDir The Docusaurus site root directory
|
|
27
|
+
* @param pluginId The plugin instance ID (for multi-instance support)
|
|
28
|
+
* @returns Path to the plugin's cache directory
|
|
29
|
+
*/
|
|
30
|
+
export declare function getSlidevCacheDir(siteDir: string, pluginId?: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Creates an isolated build directory for a single presentation
|
|
33
|
+
* Copies the source .md file to its own directory to prevent index.html conflicts
|
|
34
|
+
* during parallel builds.
|
|
35
|
+
*
|
|
36
|
+
* @param sourceAbsolutePath Absolute path to the source .md file
|
|
37
|
+
* @param presentationId The unique ID for this presentation
|
|
38
|
+
* @param cacheDir The base cache directory
|
|
39
|
+
* @returns Path to the copied .md file in the isolated directory
|
|
40
|
+
*/
|
|
41
|
+
export declare function createIsolatedBuildDir(sourceAbsolutePath: string, presentationId: string, cacheDir: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Cleans up the isolated build directory after a build completes
|
|
44
|
+
* Removes Slidev artifacts (index.html, .slidev, dist) from the isolated directory
|
|
45
|
+
*
|
|
46
|
+
* @param isolatedDir The isolated build directory to clean
|
|
47
|
+
*/
|
|
48
|
+
export declare function cleanupIsolatedBuildDir(isolatedDir: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Cleans the entire Slidev cache directory
|
|
51
|
+
* Should be called at the start of a build to ensure a clean state
|
|
52
|
+
*
|
|
53
|
+
* @param cacheDir The cache directory to clean
|
|
54
|
+
*/
|
|
55
|
+
export declare function cleanupSlidevCache(cacheDir: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* Gets the Slidev build output directory path within .docusaurus cache
|
|
58
|
+
* This is where built presentations are stored before being copied to final output
|
|
59
|
+
* @param siteDir The Docusaurus site root directory
|
|
60
|
+
* @param pluginId The plugin instance ID (for multi-instance support)
|
|
61
|
+
* @returns Path to the plugin's build output directory
|
|
62
|
+
*/
|
|
63
|
+
export declare function getSlidevBuildOutputDir(siteDir: string, pluginId?: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Copies built presentations from cache directory to final output directory
|
|
66
|
+
* This is called in the postBuild hook to copy presentations to the final build output
|
|
67
|
+
*
|
|
68
|
+
* @param cacheOutputDir The cache directory containing built presentations
|
|
69
|
+
* @param finalOutputDir The final output directory (e.g., build/slides)
|
|
70
|
+
*/
|
|
71
|
+
export declare function copyBuiltPresentationsToOutput(cacheOutputDir: string, finalOutputDir: string): void;
|
|
19
72
|
//# sourceMappingURL=fileSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystem.d.ts","sourceRoot":"","sources":["../../src/utils/fileSystem.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAyB/D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CA4B/D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAcxD"}
|
|
1
|
+
{"version":3,"file":"fileSystem.d.ts","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