@rspress/plugin-llms 2.0.0-beta.1 → 2.0.0-beta.3
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/dist/index.d.ts +12 -731
- package/dist/index.js +191 -20873
- package/dist/index.js.LICENSE.txt +10 -0
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
@@ -1,232 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
import {
|
3
|
-
import { RsbuildPlugin } from './types';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* There are two ways to define what addition routes represent.
|
7
|
-
* 1. Define filepath, then the content will be read from the file.
|
8
|
-
* 2. Define content, then then content will be written to temp file and read from it.
|
9
|
-
*/
|
10
|
-
declare interface AdditionalPage {
|
11
|
-
routePath: string;
|
12
|
-
content?: string;
|
13
|
-
filepath?: string;
|
14
|
-
}
|
15
|
-
|
16
|
-
declare interface DefaultThemeConfig {
|
17
|
-
/**
|
18
|
-
* Whether to enable dark mode.
|
19
|
-
* @default true
|
20
|
-
*/
|
21
|
-
darkMode?: boolean;
|
22
|
-
/**
|
23
|
-
* Custom outline title in the aside component.
|
24
|
-
*
|
25
|
-
* @default 'ON THIS PAGE'
|
26
|
-
*/
|
27
|
-
outlineTitle?: string;
|
28
|
-
/**
|
29
|
-
* Whether to show the sidebar in right position.
|
30
|
-
*/
|
31
|
-
outline?: boolean;
|
32
|
-
/**
|
33
|
-
* The nav items. When it's an object, the key is the version of current doc.
|
34
|
-
*/
|
35
|
-
nav?: NavItem[] | {
|
36
|
-
[key: string]: NavItem[];
|
37
|
-
};
|
38
|
-
/**
|
39
|
-
* The sidebar items.
|
40
|
-
*/
|
41
|
-
sidebar?: Sidebar;
|
42
|
-
/**
|
43
|
-
* Info for the edit link. If it's undefined, the edit link feature will
|
44
|
-
* be disabled.
|
45
|
-
*/
|
46
|
-
editLink?: EditLink;
|
47
|
-
/**
|
48
|
-
* Set custom last updated text.
|
49
|
-
*
|
50
|
-
* @default 'Last updated'
|
51
|
-
*/
|
52
|
-
lastUpdatedText?: string;
|
53
|
-
/**
|
54
|
-
* Set custom last updated text.
|
55
|
-
*
|
56
|
-
* @default false
|
57
|
-
*/
|
58
|
-
lastUpdated?: boolean;
|
59
|
-
/**
|
60
|
-
* Set custom prev/next labels.
|
61
|
-
*/
|
62
|
-
docFooter?: DocFooter;
|
63
|
-
/**
|
64
|
-
* The social links to be displayed at the end of the nav bar. Perfect for
|
65
|
-
* placing links to social services such as GitHub, X, Facebook, etc.
|
66
|
-
*/
|
67
|
-
socialLinks?: SocialLink[];
|
68
|
-
/**
|
69
|
-
* The footer configuration.
|
70
|
-
*/
|
71
|
-
footer?: Footer;
|
72
|
-
/**
|
73
|
-
* The prev page text.
|
74
|
-
*/
|
75
|
-
prevPageText?: string;
|
76
|
-
/**
|
77
|
-
* The next page text.
|
78
|
-
*/
|
79
|
-
nextPageText?: string;
|
80
|
-
/**
|
81
|
-
* The source code text.
|
82
|
-
*/
|
83
|
-
sourceCodeText?: string;
|
84
|
-
/**
|
85
|
-
* Locale config
|
86
|
-
*/
|
87
|
-
locales?: LocaleConfig[];
|
88
|
-
/**
|
89
|
-
* Whether to open the full text search
|
90
|
-
*/
|
91
|
-
search?: boolean;
|
92
|
-
/**
|
93
|
-
* The placeholder of search input
|
94
|
-
*/
|
95
|
-
searchPlaceholderText?: string;
|
96
|
-
/**
|
97
|
-
* The text of no search result
|
98
|
-
*/
|
99
|
-
searchNoResultsText?: string;
|
100
|
-
/**
|
101
|
-
* The text of suggested query text when no search result
|
102
|
-
*/
|
103
|
-
searchSuggestedQueryText?: string;
|
104
|
-
/**
|
105
|
-
* The text of overview filter
|
106
|
-
*/
|
107
|
-
overview?: FilterConfig;
|
108
|
-
/**
|
109
|
-
* The behavior of hiding navbar
|
110
|
-
*/
|
111
|
-
hideNavbar?: 'always' | 'auto' | 'never';
|
112
|
-
/**
|
113
|
-
* Whether to enable view transition animation for pages switching
|
114
|
-
*/
|
115
|
-
enableContentAnimation?: boolean;
|
116
|
-
/**
|
117
|
-
* Whether to enable view transition animation for the theme
|
118
|
-
*/
|
119
|
-
enableAppearanceAnimation?: boolean;
|
120
|
-
/**
|
121
|
-
* Enable scroll to top button on documentation
|
122
|
-
* @default false
|
123
|
-
*/
|
124
|
-
enableScrollToTop?: boolean;
|
125
|
-
/**
|
126
|
-
* Whether to redirect to the closest locale when the user visits the site
|
127
|
-
* @default 'auto'
|
128
|
-
*/
|
129
|
-
localeRedirect?: 'auto' | 'never';
|
130
|
-
/**
|
131
|
-
* Whether to show the fallback heading title when the heading title is not presented but `frontmatter.title` exists
|
132
|
-
* @default true
|
133
|
-
*/
|
134
|
-
fallbackHeadingTitle?: boolean;
|
135
|
-
}
|
136
|
-
|
137
|
-
declare interface DocFooter {
|
138
|
-
/**
|
139
|
-
* Custom label for previous page button.
|
140
|
-
*/
|
141
|
-
prev?: SidebarItem;
|
142
|
-
/**
|
143
|
-
* Custom label for next page button.
|
144
|
-
*/
|
145
|
-
next?: SidebarItem;
|
146
|
-
}
|
147
|
-
|
148
|
-
declare interface EditLink {
|
149
|
-
/**
|
150
|
-
* Custom repository url for edit link.
|
151
|
-
*/
|
152
|
-
docRepoBaseUrl: string;
|
153
|
-
/**
|
154
|
-
* Custom text for edit link.
|
155
|
-
*
|
156
|
-
* @default 'Edit this page'
|
157
|
-
*/
|
158
|
-
text?: string;
|
159
|
-
}
|
160
|
-
|
161
|
-
declare interface Feature {
|
162
|
-
icon: string;
|
163
|
-
title: string;
|
164
|
-
details: string;
|
165
|
-
span?: number;
|
166
|
-
link?: string;
|
167
|
-
}
|
168
|
-
|
169
|
-
/**
|
170
|
-
* The config of filter component
|
171
|
-
*/
|
172
|
-
declare interface FilterConfig {
|
173
|
-
filterNameText?: string;
|
174
|
-
filterPlaceholderText?: string;
|
175
|
-
filterNoResultText?: string;
|
176
|
-
}
|
177
|
-
|
178
|
-
declare interface Footer {
|
179
|
-
message?: string;
|
180
|
-
}
|
181
|
-
|
182
|
-
declare interface FrontMatterMeta {
|
183
|
-
title?: string;
|
184
|
-
description?: string;
|
185
|
-
overview?: boolean;
|
186
|
-
pageType?: PageType;
|
187
|
-
features?: Feature[];
|
188
|
-
hero?: Hero;
|
189
|
-
sidebar?: boolean;
|
190
|
-
outline?: boolean;
|
191
|
-
lineNumbers?: boolean;
|
192
|
-
overviewHeaders?: number[];
|
193
|
-
titleSuffix?: string;
|
194
|
-
head?: [string, Record<string, string>][];
|
195
|
-
context?: string;
|
196
|
-
footer?: boolean;
|
197
|
-
[key: string]: unknown;
|
198
|
-
}
|
199
|
-
|
200
|
-
declare interface Header {
|
201
|
-
id: string;
|
202
|
-
text: string;
|
203
|
-
depth: number;
|
204
|
-
charIndex: number;
|
205
|
-
}
|
206
|
-
|
207
|
-
declare interface Hero {
|
208
|
-
name: string;
|
209
|
-
text: string;
|
210
|
-
tagline: string;
|
211
|
-
image?: {
|
212
|
-
src: string | {
|
213
|
-
dark: string;
|
214
|
-
light: string;
|
215
|
-
};
|
216
|
-
alt: string;
|
217
|
-
/**
|
218
|
-
* `srcset` and `sizes` are attributes of `<img>` tag. Please refer to https://mdn.io/srcset for the usage.
|
219
|
-
* When the value is an array, rspress will join array members with commas.
|
220
|
-
**/
|
221
|
-
sizes?: string | string[];
|
222
|
-
srcset?: string | string[];
|
223
|
-
};
|
224
|
-
actions: {
|
225
|
-
text: string;
|
226
|
-
link: string;
|
227
|
-
theme: 'brand' | 'alt';
|
228
|
-
}[];
|
229
|
-
}
|
1
|
+
import type { PageIndexInfo } from '@rspress/shared';
|
2
|
+
import type { RspressPlugin } from '@rspress/shared';
|
230
3
|
|
231
4
|
export declare interface LlmsTxt {
|
232
5
|
onTitleGenerate?: (context: {
|
@@ -237,112 +10,6 @@ export declare interface LlmsTxt {
|
|
237
10
|
onAfterLlmsTxtGenerate?: (llmsTxtContent: string) => string;
|
238
11
|
}
|
239
12
|
|
240
|
-
declare interface Locale {
|
241
|
-
lang: string;
|
242
|
-
label: string;
|
243
|
-
title?: string;
|
244
|
-
description?: string;
|
245
|
-
}
|
246
|
-
|
247
|
-
/**
|
248
|
-
* locale config
|
249
|
-
*/
|
250
|
-
declare interface LocaleConfig {
|
251
|
-
/**
|
252
|
-
* Site i18n config, which will recover the locales config in the site level.
|
253
|
-
*/
|
254
|
-
lang: string;
|
255
|
-
title?: string;
|
256
|
-
description?: string;
|
257
|
-
label: string;
|
258
|
-
/**
|
259
|
-
* Theme i18n config
|
260
|
-
*/
|
261
|
-
nav?: Nav;
|
262
|
-
sidebar?: Sidebar;
|
263
|
-
outlineTitle?: string;
|
264
|
-
lastUpdatedText?: string;
|
265
|
-
lastUpdated?: boolean;
|
266
|
-
editLink?: EditLink;
|
267
|
-
prevPageText?: string;
|
268
|
-
nextPageText?: string;
|
269
|
-
sourceCodeText?: string;
|
270
|
-
langRoutePrefix?: string;
|
271
|
-
searchPlaceholderText?: string;
|
272
|
-
searchNoResultsText?: string;
|
273
|
-
searchSuggestedQueryText?: string;
|
274
|
-
overview?: FilterConfig;
|
275
|
-
}
|
276
|
-
|
277
|
-
declare type LocalSearchOptions = SearchHooks & {
|
278
|
-
mode?: 'local';
|
279
|
-
/**
|
280
|
-
* Whether to generate separate search index for each version
|
281
|
-
*/
|
282
|
-
versioned?: boolean;
|
283
|
-
/**
|
284
|
-
* If enabled, the search index will include code block content, which allows users to search code blocks.
|
285
|
-
* @default false
|
286
|
-
*/
|
287
|
-
codeBlocks?: boolean;
|
288
|
-
};
|
289
|
-
|
290
|
-
declare interface MarkdownOptions {
|
291
|
-
remarkPlugins?: PluggableList;
|
292
|
-
rehypePlugins?: PluggableList;
|
293
|
-
/**
|
294
|
-
* Whether to enable check dead links, default is false
|
295
|
-
*/
|
296
|
-
checkDeadLinks?: boolean;
|
297
|
-
showLineNumbers?: boolean;
|
298
|
-
/**
|
299
|
-
* Whether to wrap code by default, default is false
|
300
|
-
*/
|
301
|
-
defaultWrapCode?: boolean;
|
302
|
-
/**
|
303
|
-
* Register global components in mdx files
|
304
|
-
*/
|
305
|
-
globalComponents?: string[];
|
306
|
-
/**
|
307
|
-
* Code highlighter, default is prism for performance reason
|
308
|
-
*/
|
309
|
-
codeHighlighter?: 'prism' | 'shiki';
|
310
|
-
/**
|
311
|
-
* Register prism languages
|
312
|
-
*/
|
313
|
-
highlightLanguages?: (string | [string, string])[];
|
314
|
-
}
|
315
|
-
|
316
|
-
declare type Nav = NavItem[] | {
|
317
|
-
[key: string]: NavItem[];
|
318
|
-
};
|
319
|
-
|
320
|
-
declare type NavItem = NavItemWithLink | NavItemWithChildren | NavItemWithLinkAndChildren;
|
321
|
-
|
322
|
-
declare interface NavItemWithChildren {
|
323
|
-
text?: string;
|
324
|
-
tag?: string;
|
325
|
-
items: NavItemWithLink[];
|
326
|
-
position?: 'left' | 'right';
|
327
|
-
}
|
328
|
-
|
329
|
-
declare type NavItemWithLink = {
|
330
|
-
text: string;
|
331
|
-
link: string;
|
332
|
-
tag?: string;
|
333
|
-
activeMatch?: string;
|
334
|
-
position?: 'left' | 'right';
|
335
|
-
};
|
336
|
-
|
337
|
-
declare interface NavItemWithLinkAndChildren {
|
338
|
-
text: string;
|
339
|
-
link: string;
|
340
|
-
items: NavItemWithLink[];
|
341
|
-
tag?: string;
|
342
|
-
activeMatch?: string;
|
343
|
-
position?: 'left' | 'right';
|
344
|
-
}
|
345
|
-
|
346
13
|
export declare interface Options {
|
347
14
|
/**
|
348
15
|
* Whether to generate llms.txt.
|
@@ -355,12 +22,21 @@ export declare interface Options {
|
|
355
22
|
*/
|
356
23
|
mdFiles?: boolean;
|
357
24
|
/**
|
358
|
-
* Whether to generate llms
|
25
|
+
* Whether to generate llms-full.txt.
|
359
26
|
* @default true
|
360
27
|
*/
|
361
28
|
llmsFullTxt?: boolean;
|
29
|
+
/**
|
30
|
+
* Whether to include some routes from llms.txt.
|
31
|
+
* @param context
|
32
|
+
* @default (context) => context.page.lang === config.lang
|
33
|
+
*/
|
34
|
+
include?: (context: {
|
35
|
+
page: PageIndexInfo;
|
36
|
+
}) => boolean;
|
362
37
|
/**
|
363
38
|
* Whether to exclude some routes from llms.txt.
|
39
|
+
* exclude will trigger after include
|
364
40
|
* @default undefined
|
365
41
|
*/
|
366
42
|
exclude?: (context: {
|
@@ -368,404 +44,9 @@ export declare interface Options {
|
|
368
44
|
}) => boolean;
|
369
45
|
}
|
370
46
|
|
371
|
-
/**
|
372
|
-
* @description search-index.json file
|
373
|
-
* "_foo" is the private field that won't be written to search-index.json file
|
374
|
-
* and should not be used in the runtime (usePageData).
|
375
|
-
*/
|
376
|
-
declare interface PageIndexInfo {
|
377
|
-
id: number;
|
378
|
-
title: string;
|
379
|
-
routePath: string;
|
380
|
-
toc: Header[];
|
381
|
-
content: string;
|
382
|
-
_flattenContent?: string;
|
383
|
-
_html: string;
|
384
|
-
frontmatter: FrontMatterMeta;
|
385
|
-
lang: string;
|
386
|
-
version: string;
|
387
|
-
domain: string;
|
388
|
-
_filepath: string;
|
389
|
-
_relativePath: string;
|
390
|
-
}
|
391
|
-
|
392
|
-
declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
|
393
|
-
|
394
47
|
/**
|
395
48
|
* A plugin for rspress to generate llms.txt, llms-full.txt, md files to let llm understand your website.
|
396
49
|
*/
|
397
50
|
export declare function pluginLlms(options?: Options): RspressPlugin;
|
398
51
|
|
399
|
-
declare type RemoteSearchIndexInfo = string | {
|
400
|
-
value: string;
|
401
|
-
label: string;
|
402
|
-
};
|
403
|
-
|
404
|
-
declare type RemoteSearchOptions = SearchHooks & {
|
405
|
-
mode: 'remote';
|
406
|
-
apiUrl: string;
|
407
|
-
domain?: string;
|
408
|
-
indexName: string;
|
409
|
-
searchIndexes?: RemoteSearchIndexInfo[];
|
410
|
-
searchLoading?: boolean;
|
411
|
-
};
|
412
|
-
|
413
|
-
declare interface ReplaceRule {
|
414
|
-
search: string | RegExp;
|
415
|
-
replace: string;
|
416
|
-
}
|
417
|
-
|
418
|
-
declare interface RouteMeta {
|
419
|
-
routePath: string;
|
420
|
-
absolutePath: string;
|
421
|
-
relativePath: string;
|
422
|
-
pageName: string;
|
423
|
-
lang: string;
|
424
|
-
version: string;
|
425
|
-
}
|
426
|
-
|
427
|
-
declare interface RouteOptions {
|
428
|
-
/**
|
429
|
-
* The extension name of the filepath that will be converted to a route
|
430
|
-
* @default ['js','jsx','ts','tsx','md','mdx']
|
431
|
-
*/
|
432
|
-
extensions?: string[];
|
433
|
-
/**
|
434
|
-
* Include extra files from being converted to routes
|
435
|
-
*/
|
436
|
-
include?: string[];
|
437
|
-
/**
|
438
|
-
* Exclude files from being converted to routes
|
439
|
-
*/
|
440
|
-
exclude?: string[];
|
441
|
-
/**
|
442
|
-
* use links without .html files
|
443
|
-
*/
|
444
|
-
cleanUrls?: boolean;
|
445
|
-
}
|
446
|
-
|
447
|
-
declare interface RspressPlugin {
|
448
|
-
/**
|
449
|
-
* Name of the plugin.
|
450
|
-
*/
|
451
|
-
name: string;
|
452
|
-
/**
|
453
|
-
* Global style
|
454
|
-
*/
|
455
|
-
globalStyles?: string;
|
456
|
-
/**
|
457
|
-
* Markdown options.
|
458
|
-
*/
|
459
|
-
markdown?: {
|
460
|
-
remarkPlugins?: PluggableList;
|
461
|
-
rehypePlugins?: PluggableList;
|
462
|
-
globalComponents?: string[];
|
463
|
-
};
|
464
|
-
/**
|
465
|
-
* Rsbuild config.
|
466
|
-
*/
|
467
|
-
builderConfig?: RsbuildConfig;
|
468
|
-
/**
|
469
|
-
* Inject global components.
|
470
|
-
*/
|
471
|
-
globalUIComponents?: (string | [string, object])[];
|
472
|
-
/**
|
473
|
-
* Modify doc config.
|
474
|
-
*/
|
475
|
-
config?: (config: UserConfig, utils: {
|
476
|
-
addPlugin: (plugin: RspressPlugin) => void;
|
477
|
-
removePlugin: (pluginName: string) => void;
|
478
|
-
}, isProd: boolean) => UserConfig | Promise<UserConfig>;
|
479
|
-
/**
|
480
|
-
* Callback before build
|
481
|
-
*/
|
482
|
-
beforeBuild?: (config: UserConfig, isProd: boolean) => void | Promise<void>;
|
483
|
-
/**
|
484
|
-
* Callback after build
|
485
|
-
*/
|
486
|
-
afterBuild?: (config: UserConfig, isProd: boolean) => void | Promise<void>;
|
487
|
-
/**
|
488
|
-
* Extend every page's data
|
489
|
-
*/
|
490
|
-
extendPageData?: (pageData: PageIndexInfo, isProd: boolean) => void | Promise<void>;
|
491
|
-
/**
|
492
|
-
* Add custom route
|
493
|
-
*/
|
494
|
-
addPages?: (config: UserConfig, isProd: boolean) => AdditionalPage[] | Promise<AdditionalPage[]>;
|
495
|
-
/**
|
496
|
-
* Add runtime modules
|
497
|
-
*/
|
498
|
-
addRuntimeModules?: (config: UserConfig, isProd: boolean) => Record<string, string> | Promise<Record<string, string>>;
|
499
|
-
/**
|
500
|
-
* Callback after route generated
|
501
|
-
*/
|
502
|
-
routeGenerated?: (routes: RouteMeta[], isProd: boolean) => Promise<void> | void;
|
503
|
-
/**
|
504
|
-
* Callback after routeService generated
|
505
|
-
*/
|
506
|
-
routeServiceGenerated?: (routeService: any, isProd: boolean) => Promise<void> | void;
|
507
|
-
/**
|
508
|
-
* Add addition ssg routes, for dynamic routes.
|
509
|
-
*/
|
510
|
-
addSSGRoutes?: (config: UserConfig, isProd: boolean) => {
|
511
|
-
path: string;
|
512
|
-
}[] | Promise<{
|
513
|
-
path: string;
|
514
|
-
}[]>;
|
515
|
-
/**
|
516
|
-
* @private
|
517
|
-
* Modify search index data.
|
518
|
-
*/
|
519
|
-
modifySearchIndexData?: (data: PageIndexInfo[], isProd: boolean) => void | Promise<void>;
|
520
|
-
}
|
521
|
-
|
522
|
-
declare interface SearchHooks {
|
523
|
-
/**
|
524
|
-
* The search hook function path. The corresponding file should export a function named `onSearch`.
|
525
|
-
*/
|
526
|
-
searchHooks?: string;
|
527
|
-
}
|
528
|
-
|
529
|
-
declare type SearchOptions = LocalSearchOptions | RemoteSearchOptions | false;
|
530
|
-
|
531
|
-
declare interface Sidebar {
|
532
|
-
[path: string]: (SidebarGroup | SidebarItem | SidebarDivider | SidebarSectionHeader)[];
|
533
|
-
}
|
534
|
-
|
535
|
-
declare type SidebarDivider = {
|
536
|
-
dividerType: 'dashed' | 'solid';
|
537
|
-
};
|
538
|
-
|
539
|
-
declare interface SidebarGroup {
|
540
|
-
text: string;
|
541
|
-
link?: string;
|
542
|
-
tag?: string;
|
543
|
-
items: (SidebarItem | SidebarDivider | SidebarGroup | string)[];
|
544
|
-
collapsible?: boolean;
|
545
|
-
collapsed?: boolean;
|
546
|
-
/**
|
547
|
-
* For hmr usage in development
|
548
|
-
*/
|
549
|
-
_fileKey?: string;
|
550
|
-
overviewHeaders?: number[];
|
551
|
-
context?: string;
|
552
|
-
}
|
553
|
-
|
554
|
-
declare type SidebarItem = {
|
555
|
-
text: string;
|
556
|
-
link: string;
|
557
|
-
tag?: string;
|
558
|
-
/**
|
559
|
-
* For hmr usage in development
|
560
|
-
*/
|
561
|
-
_fileKey?: string;
|
562
|
-
overviewHeaders?: number[];
|
563
|
-
context?: string;
|
564
|
-
};
|
565
|
-
|
566
|
-
declare type SidebarSectionHeader = {
|
567
|
-
sectionHeaderText: string;
|
568
|
-
tag?: string;
|
569
|
-
};
|
570
|
-
|
571
|
-
declare interface SocialLink {
|
572
|
-
icon: SocialLinkIcon;
|
573
|
-
mode: 'link' | 'text' | 'img' | 'dom';
|
574
|
-
content: string;
|
575
|
-
}
|
576
|
-
|
577
|
-
declare type SocialLinkIcon = 'lark' | 'discord' | 'facebook' | 'github' | 'instagram' | 'linkedin' | 'slack' | 'x' | 'youtube' | 'wechat' | 'qq' | 'juejin' | 'zhihu' | 'bilibili' | 'weibo' | 'gitlab' | 'X' | 'bluesky' | {
|
578
|
-
svg: string;
|
579
|
-
};
|
580
|
-
|
581
|
-
declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
|
582
|
-
/**
|
583
|
-
* The root directory of the site.
|
584
|
-
* @default 'docs'
|
585
|
-
*/
|
586
|
-
root?: string;
|
587
|
-
/**
|
588
|
-
* Path to the logo file in nav bar.
|
589
|
-
*/
|
590
|
-
logo?: string | {
|
591
|
-
dark: string;
|
592
|
-
light: string;
|
593
|
-
};
|
594
|
-
/**
|
595
|
-
* The text of the logo in nav bar.
|
596
|
-
* @default ''
|
597
|
-
*/
|
598
|
-
logoText?: string;
|
599
|
-
/**
|
600
|
-
* Base path of the site.
|
601
|
-
* @default '/'
|
602
|
-
*/
|
603
|
-
base?: string;
|
604
|
-
/**
|
605
|
-
* Path to html icon file.
|
606
|
-
*/
|
607
|
-
icon?: string;
|
608
|
-
/**
|
609
|
-
* Default language of the site.
|
610
|
-
*/
|
611
|
-
lang?: string;
|
612
|
-
/**
|
613
|
-
* Title of the site.
|
614
|
-
* @default 'Rspress'
|
615
|
-
*/
|
616
|
-
title?: string;
|
617
|
-
/**
|
618
|
-
* Description of the site.
|
619
|
-
* @default ''
|
620
|
-
*/
|
621
|
-
description?: string;
|
622
|
-
/**
|
623
|
-
* Head tags.
|
624
|
-
*/
|
625
|
-
head?: (string | [string, Record<string, string>] | ((route: RouteMeta) => string | [string, Record<string, string>] | undefined))[];
|
626
|
-
/**
|
627
|
-
* I18n config of the site.
|
628
|
-
*/
|
629
|
-
locales?: Locale[];
|
630
|
-
/**
|
631
|
-
* The i18n text data source path. Default is `i18n.json` in cwd.
|
632
|
-
*/
|
633
|
-
i18nSourcePath?: string;
|
634
|
-
/**
|
635
|
-
* Theme config.
|
636
|
-
*/
|
637
|
-
themeConfig?: ThemeConfig;
|
638
|
-
/**
|
639
|
-
* Rsbuild Configuration
|
640
|
-
*/
|
641
|
-
builderConfig?: RsbuildConfig;
|
642
|
-
/**
|
643
|
-
* The custom config of vite-plugin-route
|
644
|
-
*/
|
645
|
-
route?: RouteOptions;
|
646
|
-
/**
|
647
|
-
* The custom config of markdown compile
|
648
|
-
*/
|
649
|
-
markdown?: MarkdownOptions;
|
650
|
-
/**
|
651
|
-
* Doc plugins
|
652
|
-
*/
|
653
|
-
plugins?: RspressPlugin[];
|
654
|
-
/**
|
655
|
-
* Replace rule, will replace the content of the page.
|
656
|
-
*/
|
657
|
-
replaceRules?: ReplaceRule[];
|
658
|
-
/**
|
659
|
-
* Output directory
|
660
|
-
*/
|
661
|
-
outDir?: string;
|
662
|
-
/**
|
663
|
-
* Custom theme directory
|
664
|
-
*/
|
665
|
-
themeDir?: string;
|
666
|
-
/**
|
667
|
-
* Global components
|
668
|
-
*/
|
669
|
-
globalUIComponents?: (string | [string, object])[];
|
670
|
-
/**
|
671
|
-
* Global styles, is a Absolute path
|
672
|
-
*/
|
673
|
-
globalStyles?: string;
|
674
|
-
/**
|
675
|
-
* Search options
|
676
|
-
*/
|
677
|
-
search?: SearchOptions;
|
678
|
-
/**
|
679
|
-
* Whether to enable ssg, default is true
|
680
|
-
*/
|
681
|
-
ssg?: boolean;
|
682
|
-
/**
|
683
|
-
* Whether to enable medium-zoom, default is true
|
684
|
-
*/
|
685
|
-
mediumZoom?: boolean | {
|
686
|
-
selector?: string;
|
687
|
-
options?: ZoomOptions;
|
688
|
-
};
|
689
|
-
/**
|
690
|
-
* Add some extra builder plugins
|
691
|
-
*/
|
692
|
-
builderPlugins?: RsbuildPlugin[];
|
693
|
-
/**
|
694
|
-
* Multi version config
|
695
|
-
*/
|
696
|
-
multiVersion?: {
|
697
|
-
/**
|
698
|
-
* The default version
|
699
|
-
*/
|
700
|
-
default?: string;
|
701
|
-
/**
|
702
|
-
* The version list, such as ['v1', 'v2']
|
703
|
-
*/
|
704
|
-
versions: string[];
|
705
|
-
};
|
706
|
-
/**
|
707
|
-
* Language parity checking config
|
708
|
-
*/
|
709
|
-
languageParity?: {
|
710
|
-
/**
|
711
|
-
* Whether to enable language parity checking
|
712
|
-
*/
|
713
|
-
enabled?: boolean;
|
714
|
-
/**
|
715
|
-
* Directories to include in the parity check
|
716
|
-
*/
|
717
|
-
include?: string[];
|
718
|
-
/**
|
719
|
-
* Directories to exclude from the parity check
|
720
|
-
*/
|
721
|
-
exclude?: string[];
|
722
|
-
};
|
723
|
-
}
|
724
|
-
|
725
|
-
declare interface ZoomContainer {
|
726
|
-
width?: number
|
727
|
-
height?: number
|
728
|
-
top?: number
|
729
|
-
bottom?: number
|
730
|
-
right?: number
|
731
|
-
left?: number
|
732
|
-
}
|
733
|
-
|
734
|
-
declare interface ZoomOptions {
|
735
|
-
/**
|
736
|
-
* The space outside the zoomed image.
|
737
|
-
*
|
738
|
-
* @default 0
|
739
|
-
*/
|
740
|
-
margin?: number
|
741
|
-
|
742
|
-
/**
|
743
|
-
* The background of the overlay.
|
744
|
-
*
|
745
|
-
* @default '#fff'
|
746
|
-
*/
|
747
|
-
background?: string
|
748
|
-
|
749
|
-
/**
|
750
|
-
* The number of pixels to scroll to close the zoom.
|
751
|
-
*
|
752
|
-
* @default 40
|
753
|
-
*/
|
754
|
-
scrollOffset?: number
|
755
|
-
|
756
|
-
/**
|
757
|
-
* The viewport to render the zoom in.
|
758
|
-
*
|
759
|
-
* @default null
|
760
|
-
*/
|
761
|
-
container?: string | HTMLElement | ZoomContainer
|
762
|
-
|
763
|
-
/**
|
764
|
-
* The template element to display on zoom.
|
765
|
-
*
|
766
|
-
* @default null
|
767
|
-
*/
|
768
|
-
template?: string | HTMLTemplateElement
|
769
|
-
}
|
770
|
-
|
771
52
|
export { }
|