vitepress 1.0.0-draft.3 → 1.0.0-draft.6
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/README.md +3 -1
- package/bin/vitepress.js +1 -1
- package/dist/client/app/composables/head.js +2 -2
- package/dist/client/app/data.js +2 -4
- package/dist/client/app/index.js +1 -5
- package/dist/client/index.d.ts +123 -134
- package/dist/client/index.js +1 -2
- package/dist/client/shared.js +21 -0
- package/dist/client/theme-default/Layout.vue +7 -0
- package/dist/client/theme-default/NotFound.vue +74 -14
- package/dist/client/theme-default/components/VPBox.vue +2 -6
- package/dist/client/theme-default/components/VPButton.vue +0 -1
- package/dist/client/theme-default/components/VPCarbonAds.vue +90 -0
- package/dist/client/theme-default/components/VPContent.vue +14 -10
- package/dist/client/theme-default/components/VPDoc.vue +73 -58
- package/dist/client/theme-default/components/VPDocAside.vue +34 -0
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +13 -0
- package/dist/client/theme-default/components/{VPDocOutline.vue → VPDocAsideOutline.vue} +14 -3
- package/dist/client/theme-default/components/VPDocAsideSponsors.vue +32 -0
- package/dist/client/theme-default/components/VPDocFooter.vue +1 -1
- package/dist/client/theme-default/components/VPFlyout.vue +2 -3
- package/dist/client/theme-default/components/VPFooter.vue +1 -1
- package/dist/client/theme-default/components/VPHero.vue +170 -29
- package/dist/client/theme-default/components/VPHomeFeatures.vue +1 -0
- package/dist/client/theme-default/components/VPHomeHero.vue +1 -0
- package/dist/client/theme-default/components/VPHomeSponsors.vue +3 -3
- package/dist/client/theme-default/components/VPLink.vue +2 -1
- package/dist/client/theme-default/components/VPLocalNav.vue +1 -1
- package/dist/client/theme-default/components/VPMenu.vue +9 -14
- package/dist/client/theme-default/components/VPMenuLink.vue +10 -4
- package/dist/client/theme-default/components/VPNav.vue +18 -1
- package/dist/client/theme-default/components/VPNavBar.vue +20 -8
- package/dist/client/theme-default/components/VPNavBarExtra.vue +20 -45
- package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +2 -8
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +3 -3
- package/dist/client/theme-default/components/VPNavBarSearch.vue +6 -6
- package/dist/client/theme-default/components/VPNavBarTitle.vue +4 -2
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +10 -39
- package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +1 -2
- package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +1 -1
- package/dist/client/theme-default/components/VPSidebar.vue +12 -6
- package/dist/client/theme-default/components/VPSidebarGroup.vue +80 -17
- package/dist/client/theme-default/components/VPSidebarLink.vue +2 -9
- package/dist/client/theme-default/components/VPSocialLink.vue +2 -2
- package/dist/client/theme-default/components/VPSocialLinks.vue +1 -1
- package/dist/client/theme-default/components/VPSponsors.vue +15 -40
- package/dist/client/theme-default/components/VPSponsorsGrid.vue +2 -2
- package/dist/client/theme-default/components/icons/VPIconMinus.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +6 -0
- package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +6 -0
- package/dist/client/theme-default/composables/aside.js +17 -0
- package/dist/client/theme-default/composables/copy-code.js +33 -0
- package/dist/client/theme-default/composables/outline.js +14 -4
- package/dist/client/theme-default/composables/sponsor-grid.js +8 -6
- package/dist/client/theme-default/index.js +4 -2
- package/dist/client/theme-default/styles/base.css +13 -1
- package/dist/client/theme-default/styles/components/custom-block.css +90 -0
- package/dist/client/theme-default/styles/{vp-doc.css → components/vp-doc.css} +152 -115
- package/dist/client/theme-default/styles/{vp-sponsor.css → components/vp-sponsor.css} +51 -7
- package/dist/client/theme-default/styles/vars.css +109 -58
- package/dist/node/cli.js +32 -31
- package/dist/node/index.d.ts +371 -361
- package/dist/node/index.js +22 -37
- package/dist/node/serve-9c85885c.js +64795 -0
- package/dist/node-cjs/cli.cjs +304 -0
- package/dist/node-cjs/index.cjs +38 -0
- package/dist/{node/serve-b5dc02b2.js → node-cjs/serve-a73b4871.cjs} +27405 -28602
- package/package.json +47 -40
- package/theme.d.ts +7 -2
- package/types/default-theme.d.ts +15 -2
- package/types/shared.d.ts +3 -0
package/dist/node/index.d.ts
CHANGED
|
@@ -1,361 +1,371 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import MarkdownIt from 'markdown-it';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
| '
|
|
154
|
-
| '
|
|
155
|
-
| '
|
|
156
|
-
| '
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
1
|
+
import * as vite from 'vite';
|
|
2
|
+
import { UserConfig as UserConfig$1, AliasOptions, ServerOptions, BuildOptions } from 'vite';
|
|
3
|
+
import { Options } from '@vitejs/plugin-vue';
|
|
4
|
+
import MarkdownIt from 'markdown-it';
|
|
5
|
+
import { Theme } from 'shiki';
|
|
6
|
+
import anchor from 'markdown-it-anchor';
|
|
7
|
+
|
|
8
|
+
declare namespace DefaultTheme {
|
|
9
|
+
export interface Config {
|
|
10
|
+
/**
|
|
11
|
+
* The logo file of the site.
|
|
12
|
+
*
|
|
13
|
+
* @example '/logo.svg'
|
|
14
|
+
*/
|
|
15
|
+
logo?: string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The nav items.
|
|
19
|
+
*/
|
|
20
|
+
nav?: NavItem[]
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The sidebar items.
|
|
24
|
+
*/
|
|
25
|
+
sidebar?: Sidebar
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Info for the edit link. If it's undefined, the edit link feature will
|
|
29
|
+
* be disabled.
|
|
30
|
+
*/
|
|
31
|
+
editLink?: EditLink
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The social links to be displayed at the end of the nav bar. Perfect for
|
|
35
|
+
* placing links to social services such as GitHub, Twitter, Facebook, etc.
|
|
36
|
+
*/
|
|
37
|
+
socialLinks?: SocialLink[]
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The footer configuration.
|
|
41
|
+
*/
|
|
42
|
+
footer?: Footer
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Adds locale menu to the nav. This option should be used when you have
|
|
46
|
+
* your translated sites outside of the project.
|
|
47
|
+
*/
|
|
48
|
+
localeLinks?: LocaleLinks
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The algolia options. Leave it undefined to disable the search feature.
|
|
52
|
+
*/
|
|
53
|
+
algolia?: AlgoliaSearchOptions
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The carbon ads options. Leave it undefined to disable the ads feature.
|
|
57
|
+
*/
|
|
58
|
+
carbonAds?: CarbonAdsOptions
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// nav -----------------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
export type NavItem = NavItemWithLink | NavItemWithChildren
|
|
64
|
+
|
|
65
|
+
export type NavItemWithLink = {
|
|
66
|
+
text: string
|
|
67
|
+
link: string
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* `activeMatch` is expected to be a regex string. We can't use actual
|
|
71
|
+
* RegExp object here because it isn't serializable
|
|
72
|
+
*/
|
|
73
|
+
activeMatch?: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface NavItemWithChildren {
|
|
77
|
+
text?: string
|
|
78
|
+
items: NavItemWithLink[]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// sidebar -------------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
export type Sidebar = SidebarGroup[] | SidebarMulti
|
|
84
|
+
|
|
85
|
+
export interface SidebarMulti {
|
|
86
|
+
[path: string]: SidebarGroup[]
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface SidebarGroup {
|
|
90
|
+
text: string
|
|
91
|
+
items: SidebarItem[]
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* If `true`, toggle button is shown.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
collapsible?: boolean
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* If `true`, collapsible group is collapsed by default.
|
|
102
|
+
*
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
collapsed?: boolean
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface SidebarItem {
|
|
109
|
+
text: string
|
|
110
|
+
link: string
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// edit link -----------------------------------------------------------------
|
|
114
|
+
|
|
115
|
+
export interface EditLink {
|
|
116
|
+
/**
|
|
117
|
+
* Repo of the site.
|
|
118
|
+
*
|
|
119
|
+
* @example 'vuejs/docs'
|
|
120
|
+
*/
|
|
121
|
+
repo: string
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Branch of the repo.
|
|
125
|
+
*
|
|
126
|
+
* @default 'main'
|
|
127
|
+
*/
|
|
128
|
+
branch?: string
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* If your docs are not at the root of the repo.
|
|
132
|
+
*
|
|
133
|
+
* @example 'docs'
|
|
134
|
+
*/
|
|
135
|
+
dir?: string
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Custom text for edit link.
|
|
139
|
+
*
|
|
140
|
+
* @default 'Edit this page'
|
|
141
|
+
*/
|
|
142
|
+
text?: string
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// social link ---------------------------------------------------------------
|
|
146
|
+
|
|
147
|
+
export interface SocialLink {
|
|
148
|
+
icon: SocialLinkIcon
|
|
149
|
+
link: string
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export type SocialLinkIcon =
|
|
153
|
+
| 'discord'
|
|
154
|
+
| 'facebook'
|
|
155
|
+
| 'github'
|
|
156
|
+
| 'instagram'
|
|
157
|
+
| 'linkedin'
|
|
158
|
+
| 'slack'
|
|
159
|
+
| 'twitter'
|
|
160
|
+
| 'youtube'
|
|
161
|
+
|
|
162
|
+
// footer --------------------------------------------------------------------
|
|
163
|
+
|
|
164
|
+
export interface Footer {
|
|
165
|
+
message?: string
|
|
166
|
+
copyright?: string
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// locales -------------------------------------------------------------------
|
|
170
|
+
|
|
171
|
+
export interface LocaleLinks {
|
|
172
|
+
text: string
|
|
173
|
+
items: LocaleLink[]
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface LocaleLink {
|
|
177
|
+
text: string
|
|
178
|
+
link: string
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// algolia ------------------------------------------------------------------
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The Algolia search options. Partially copied from
|
|
185
|
+
* `@docsearch/react/dist/esm/DocSearch.d.ts`
|
|
186
|
+
*/
|
|
187
|
+
export interface AlgoliaSearchOptions {
|
|
188
|
+
appId: string
|
|
189
|
+
apiKey: string
|
|
190
|
+
indexName: string
|
|
191
|
+
placeholder?: string
|
|
192
|
+
searchParameters?: any
|
|
193
|
+
disableUserPersonalization?: boolean
|
|
194
|
+
initialQuery?: string
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// carbon ads ----------------------------------------------------------------
|
|
198
|
+
|
|
199
|
+
export interface CarbonAdsOptions {
|
|
200
|
+
code: string
|
|
201
|
+
placement: string
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// types shared between server and client
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
interface Header {
|
|
209
|
+
level: number
|
|
210
|
+
title: string
|
|
211
|
+
slug: string
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
interface SiteData<ThemeConfig = any> {
|
|
215
|
+
base: string
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Language of the site as it should be set on the `html` element.
|
|
219
|
+
*
|
|
220
|
+
* @example `en-US`, `zh-CN`
|
|
221
|
+
*/
|
|
222
|
+
lang: string
|
|
223
|
+
|
|
224
|
+
title: string
|
|
225
|
+
titleTemplate?: string | boolean
|
|
226
|
+
description: string
|
|
227
|
+
head: HeadConfig[]
|
|
228
|
+
appearance: boolean
|
|
229
|
+
themeConfig: ThemeConfig
|
|
230
|
+
scrollOffset: number | string
|
|
231
|
+
locales: Record<string, LocaleConfig>
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Available locales for the site when it has defined `locales` in its
|
|
235
|
+
* `themeConfig`. This object is otherwise empty. Keys are paths like `/` or
|
|
236
|
+
* `/zh/`.
|
|
237
|
+
*/
|
|
238
|
+
langs: Record<
|
|
239
|
+
string,
|
|
240
|
+
{
|
|
241
|
+
/**
|
|
242
|
+
* Lang attribute as set on the `<html>` element.
|
|
243
|
+
* @example `en-US`, `zh-CN`
|
|
244
|
+
*/
|
|
245
|
+
lang: string
|
|
246
|
+
/**
|
|
247
|
+
* Label to display in the language menu.
|
|
248
|
+
* @example `English`, `简体中文`
|
|
249
|
+
*/
|
|
250
|
+
label: string
|
|
251
|
+
}
|
|
252
|
+
>
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
type HeadConfig =
|
|
256
|
+
| [string, Record<string, string>]
|
|
257
|
+
| [string, Record<string, string>, string]
|
|
258
|
+
|
|
259
|
+
interface LocaleConfig {
|
|
260
|
+
lang: string
|
|
261
|
+
title?: string
|
|
262
|
+
titleTemplate?: string | boolean
|
|
263
|
+
description?: string
|
|
264
|
+
head?: HeadConfig[]
|
|
265
|
+
label?: string
|
|
266
|
+
selectText?: string
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare function resolveSiteDataByRoute(siteData: SiteData, route: string): SiteData;
|
|
270
|
+
|
|
271
|
+
interface MarkdownOptions extends MarkdownIt.Options {
|
|
272
|
+
lineNumbers?: boolean;
|
|
273
|
+
config?: (md: MarkdownIt) => void;
|
|
274
|
+
anchor?: {
|
|
275
|
+
permalink?: anchor.AnchorOptions['permalink'];
|
|
276
|
+
};
|
|
277
|
+
attrs?: {
|
|
278
|
+
leftDelimiter?: string;
|
|
279
|
+
rightDelimiter?: string;
|
|
280
|
+
allowedAttributes?: string[];
|
|
281
|
+
disable?: boolean;
|
|
282
|
+
};
|
|
283
|
+
theme?: Theme;
|
|
284
|
+
toc?: any;
|
|
285
|
+
externalLinks?: Record<string, string>;
|
|
286
|
+
}
|
|
287
|
+
interface MarkdownParsedData {
|
|
288
|
+
hoistedTags?: string[];
|
|
289
|
+
links?: string[];
|
|
290
|
+
headers?: Header[];
|
|
291
|
+
}
|
|
292
|
+
interface MarkdownRenderer extends MarkdownIt {
|
|
293
|
+
__path: string;
|
|
294
|
+
__relativePath: string;
|
|
295
|
+
__data: MarkdownParsedData;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
declare const createMarkdownRenderer: (srcDir: string, options: MarkdownOptions | undefined, base: string) => Promise<MarkdownRenderer>;
|
|
299
|
+
|
|
300
|
+
interface UserConfig<ThemeConfig = any> {
|
|
301
|
+
extends?: RawConfigExports<ThemeConfig>;
|
|
302
|
+
base?: string;
|
|
303
|
+
lang?: string;
|
|
304
|
+
title?: string;
|
|
305
|
+
titleTemplate?: string | boolean;
|
|
306
|
+
description?: string;
|
|
307
|
+
head?: HeadConfig[];
|
|
308
|
+
appearance?: boolean;
|
|
309
|
+
themeConfig?: ThemeConfig;
|
|
310
|
+
locales?: Record<string, LocaleConfig>;
|
|
311
|
+
markdown?: MarkdownOptions;
|
|
312
|
+
lastUpdated?: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Options to pass on to `@vitejs/plugin-vue`
|
|
315
|
+
*/
|
|
316
|
+
vue?: Options;
|
|
317
|
+
/**
|
|
318
|
+
* Vite config
|
|
319
|
+
*/
|
|
320
|
+
vite?: UserConfig$1;
|
|
321
|
+
srcDir?: string;
|
|
322
|
+
srcExclude?: string[];
|
|
323
|
+
outDir?: string;
|
|
324
|
+
shouldPreload?: (link: string, page: string) => boolean;
|
|
325
|
+
/**
|
|
326
|
+
* Configure the scroll offset when the theme has a sticky header.
|
|
327
|
+
* Can be a number or a selector element to get the offset from.
|
|
328
|
+
*/
|
|
329
|
+
scrollOffset?: number | string;
|
|
330
|
+
/**
|
|
331
|
+
* Enable MPA / zero-JS mode
|
|
332
|
+
* @experimental
|
|
333
|
+
*/
|
|
334
|
+
mpa?: boolean;
|
|
335
|
+
}
|
|
336
|
+
declare type RawConfigExports<ThemeConfig = any> = UserConfig<ThemeConfig> | Promise<UserConfig<ThemeConfig>> | (() => UserConfig<ThemeConfig> | Promise<UserConfig<ThemeConfig>>);
|
|
337
|
+
interface SiteConfig<ThemeConfig = any> extends Pick<UserConfig, 'markdown' | 'vue' | 'vite' | 'shouldPreload' | 'mpa' | 'lastUpdated'> {
|
|
338
|
+
root: string;
|
|
339
|
+
srcDir: string;
|
|
340
|
+
site: SiteData<ThemeConfig>;
|
|
341
|
+
configPath: string | undefined;
|
|
342
|
+
themeDir: string;
|
|
343
|
+
outDir: string;
|
|
344
|
+
tempDir: string;
|
|
345
|
+
alias: AliasOptions;
|
|
346
|
+
pages: string[];
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Type config helper
|
|
350
|
+
*/
|
|
351
|
+
declare function defineConfig(config: UserConfig<DefaultTheme.Config>): UserConfig<DefaultTheme.Config>;
|
|
352
|
+
/**
|
|
353
|
+
* Type config helper for custom theme config
|
|
354
|
+
*/
|
|
355
|
+
declare function defineConfigWithTheme<ThemeConfig>(config: UserConfig<ThemeConfig>): UserConfig<ThemeConfig>;
|
|
356
|
+
declare function resolveConfig(root?: string, command?: 'serve' | 'build', mode?: string): Promise<SiteConfig>;
|
|
357
|
+
declare function resolveSiteData(root: string, userConfig?: UserConfig, command?: 'serve' | 'build', mode?: string): Promise<SiteData>;
|
|
358
|
+
|
|
359
|
+
declare function createServer(root?: string, serverOptions?: ServerOptions): Promise<vite.ViteDevServer>;
|
|
360
|
+
|
|
361
|
+
declare function build(root: string, buildOptions?: BuildOptions & {
|
|
362
|
+
mpa?: string;
|
|
363
|
+
}): Promise<void>;
|
|
364
|
+
|
|
365
|
+
interface ServeOptions {
|
|
366
|
+
root?: string;
|
|
367
|
+
port?: number;
|
|
368
|
+
}
|
|
369
|
+
declare function serve(options?: ServeOptions): Promise<void>;
|
|
370
|
+
|
|
371
|
+
export { DefaultTheme, HeadConfig, Header, LocaleConfig, MarkdownOptions, MarkdownParsedData, MarkdownRenderer, RawConfigExports, ServeOptions, SiteConfig, SiteData, UserConfig, build, createMarkdownRenderer, createServer, defineConfig, defineConfigWithTheme, resolveConfig, resolveSiteData, resolveSiteDataByRoute, serve };
|