@rspress/core 2.0.11 → 2.0.12
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/0~execa.js +1 -1
- package/dist/8006.js +1 -1
- package/dist/8857.js +1 -1
- package/dist/eject-theme/components/PackageManagerTabs/index.tsx +16 -17
- package/dist/eject-theme/components/Search/SearchPanel.tsx +1 -6
- package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +1 -1
- package/dist/eject-theme/components/Tabs/index.tsx +48 -41
- package/dist/node/PluginDriver.js +1 -1
- package/dist/node/auto-nav-sidebar/index.js +1 -1
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.d.ts +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +1 -1
- package/dist/node/auto-nav-sidebar/utils.js +1 -1
- package/dist/node/auto-nav-sidebar/walk.js +1 -1
- package/dist/node/initRsbuild.js +1 -1
- package/dist/node/mdx/rehypePlugins/transformers/add-title.js +3 -6
- package/dist/node/mdx/remarkPlugins/containerSyntax.d.ts +1 -1
- package/dist/node/mdx/remarkPlugins/image.d.ts +1 -1
- package/dist/node/mdx/remarkPlugins/image.js +1 -0
- package/dist/node/mdx/remarkPlugins/link.d.ts +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.js +1 -1
- package/dist/node/route/extractPageData.js +1 -1
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +140 -140
- package/dist/node/runtimeModule/i18n.js +1 -1
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.d.ts +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
- package/dist/node/runtimeModule/searchHooks.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/renderPages.js +1 -1
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
- package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
- package/dist/node/ssg-md/renderPage.js +1 -1
- package/dist/node/ssg-md/renderPages.js +1 -1
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/reactAlias.js +1 -1
- package/dist/theme/components/DocContent/docComponents/a.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/hr.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/img.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/index.d.ts +18 -18
- package/dist/theme/components/DocContent/docComponents/list.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/paragraph.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/table.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/title.d.ts +6 -6
- package/dist/theme/components/Nav/hooks.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/index.js +17 -17
- package/dist/theme/components/Search/SearchPanel.js +1 -2
- package/dist/theme/components/Sidebar/SidebarItem.js +1 -0
- package/dist/theme/components/Tabs/index.d.ts +8 -4
- package/dist/theme/components/Tabs/index.js +19 -19
- package/package.json +6 -6
- /package/dist/{5810.js → 2235.js} +0 -0
package/dist/0~execa.js
CHANGED
|
@@ -8,7 +8,7 @@ import { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
|
8
8
|
import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
9
9
|
import { debuglog } from "node:util";
|
|
10
10
|
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
11
|
-
import "./
|
|
11
|
+
import "./2235.js";
|
|
12
12
|
__webpack_require__.add({
|
|
13
13
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
14
14
|
const cp = __webpack_require__("child_process");
|
package/dist/8006.js
CHANGED
package/dist/8857.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! LICENSE: 8857.js.LICENSE.txt */
|
|
2
2
|
import { __webpack_require__ } from "./0~rslib-runtime.js";
|
|
3
|
-
import "./
|
|
3
|
+
import "./2235.js";
|
|
4
4
|
import { createRequire as __rspack_createRequire } from "node:module";
|
|
5
5
|
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
6
6
|
__webpack_require__.add({
|
|
@@ -231,27 +231,26 @@ export function PackageManagerTabs({
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
return (
|
|
234
|
-
<Tabs
|
|
235
|
-
groupId="package.manager"
|
|
236
|
-
values={Object.entries(commandInfo).map(([key]) => (
|
|
237
|
-
<div
|
|
238
|
-
key={key}
|
|
239
|
-
style={{
|
|
240
|
-
display: 'flex',
|
|
241
|
-
alignItems: 'center',
|
|
242
|
-
fontSize: 15,
|
|
243
|
-
}}
|
|
244
|
-
>
|
|
245
|
-
{packageMangerToIcon[key]}
|
|
246
|
-
<span style={{ marginLeft: 6, marginBottom: 2 }}>{key}</span>
|
|
247
|
-
</div>
|
|
248
|
-
))}
|
|
249
|
-
>
|
|
234
|
+
<Tabs groupId="package.manager">
|
|
250
235
|
{Object.entries(commandInfo).map(([key, value]) => {
|
|
251
236
|
const [packageManager, command] = splitTo2Parts(value);
|
|
252
237
|
|
|
253
238
|
return (
|
|
254
|
-
<Tab
|
|
239
|
+
<Tab
|
|
240
|
+
key={key}
|
|
241
|
+
label={
|
|
242
|
+
<div
|
|
243
|
+
style={{
|
|
244
|
+
display: 'flex',
|
|
245
|
+
alignItems: 'center',
|
|
246
|
+
fontSize: 15,
|
|
247
|
+
}}
|
|
248
|
+
>
|
|
249
|
+
{packageMangerToIcon[key]}
|
|
250
|
+
<span style={{ marginLeft: 6, marginBottom: 2 }}>{key}</span>
|
|
251
|
+
</div>
|
|
252
|
+
}
|
|
253
|
+
>
|
|
255
254
|
<Pre
|
|
256
255
|
lang="bash"
|
|
257
256
|
className="shiki css-variables"
|
|
@@ -388,15 +388,10 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
|
|
|
388
388
|
);
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
const tabValues = result.map(item => {
|
|
392
|
-
return item.group;
|
|
393
|
-
});
|
|
394
|
-
|
|
395
391
|
const renderKey = 'render' as const;
|
|
396
392
|
|
|
397
393
|
return (
|
|
398
394
|
<Tabs
|
|
399
|
-
values={tabValues}
|
|
400
395
|
className="rp-search-panel__tabs"
|
|
401
396
|
onChange={index => {
|
|
402
397
|
setResultTabIndex(index);
|
|
@@ -406,7 +401,7 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
|
|
|
406
401
|
ref={searchResultTabRef}
|
|
407
402
|
>
|
|
408
403
|
{result.map(item => (
|
|
409
|
-
<Tab key={item.group}>
|
|
404
|
+
<Tab key={item.group} label={item.group}>
|
|
410
405
|
{item.renderType === RenderType.Default &&
|
|
411
406
|
renderSearchResultItem(item.result, query, isSearching)}
|
|
412
407
|
{item.renderType === RenderType.Custom &&
|
|
@@ -56,7 +56,7 @@ export function SidebarItemRaw({
|
|
|
56
56
|
const innerContent = (
|
|
57
57
|
<>
|
|
58
58
|
<div className="rp-sidebar-item__left" ref={ref}>
|
|
59
|
-
<span {...renderInlineMarkdown(text)}></span>
|
|
59
|
+
<span className="rp-doc" {...renderInlineMarkdown(text)}></span>
|
|
60
60
|
{left}
|
|
61
61
|
</div>
|
|
62
62
|
<div className="rp-sidebar-item__right">
|
|
@@ -13,17 +13,25 @@ import {
|
|
|
13
13
|
import './index.scss';
|
|
14
14
|
|
|
15
15
|
type TabItem = {
|
|
16
|
-
label
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
value: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type ResolvedTabItem = {
|
|
22
|
+
label?: ReactNode;
|
|
23
|
+
value?: string;
|
|
17
24
|
disabled?: boolean;
|
|
18
25
|
content?: ReactNode;
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
export interface TabsProps {
|
|
22
|
-
values?:
|
|
29
|
+
values?: ReadonlyArray<TabItem>;
|
|
23
30
|
/**
|
|
24
31
|
* @default 0
|
|
25
32
|
*/
|
|
26
33
|
defaultIndex?: number;
|
|
34
|
+
defaultValue?: string;
|
|
27
35
|
onChange?: (index: number) => void;
|
|
28
36
|
children: ReactNode;
|
|
29
37
|
/**
|
|
@@ -45,56 +53,41 @@ export interface TabsProps {
|
|
|
45
53
|
|
|
46
54
|
function getTabValuesFromChildren(
|
|
47
55
|
children: ReactElement<TabProps>[],
|
|
48
|
-
|
|
49
|
-
):
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// 1. values only contain label
|
|
57
|
-
// <Tabs values={['Tab1', 'Tab2']}><Tab label="Tab1"/></Tab><Tab label="Tab2"/></Tab></Tabs>
|
|
58
|
-
if (defaultValues && defaultValues.length > 0) {
|
|
59
|
-
return defaultValues.map((item, index) => {
|
|
60
|
-
if (isTabItem(item)) {
|
|
61
|
-
return item;
|
|
62
|
-
}
|
|
56
|
+
values: ReadonlyArray<TabItem> | undefined,
|
|
57
|
+
): ResolvedTabItem[] {
|
|
58
|
+
if (values && values.length > 0) {
|
|
59
|
+
return values.map((item, index) => {
|
|
60
|
+
const content =
|
|
61
|
+
children.find(child => child.props?.value === item.value) ??
|
|
62
|
+
children[index];
|
|
63
63
|
|
|
64
64
|
return {
|
|
65
|
-
|
|
66
|
-
content
|
|
67
|
-
} satisfies
|
|
65
|
+
...item,
|
|
66
|
+
content,
|
|
67
|
+
} satisfies ResolvedTabItem;
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
// <Tabs><Tab label="Tab1"/></Tab><Tab label="Tab2"/></Tab></Tabs>
|
|
73
|
-
return Children.map<TabItem, ReactElement<TabProps>>(
|
|
71
|
+
return Children.map<ResolvedTabItem, ReactElement<TabProps>>(
|
|
74
72
|
children,
|
|
75
73
|
(child, index) => {
|
|
76
74
|
if (isValidElement(child)) {
|
|
77
75
|
return {
|
|
78
76
|
label: child.props?.label || undefined,
|
|
77
|
+
value: child.props?.value,
|
|
78
|
+
disabled: child.props?.disabled,
|
|
79
79
|
content: children[index],
|
|
80
|
-
} satisfies
|
|
80
|
+
} satisfies ResolvedTabItem;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
return {
|
|
84
84
|
label: index,
|
|
85
85
|
content: children[index],
|
|
86
|
-
} satisfies
|
|
86
|
+
} satisfies ResolvedTabItem;
|
|
87
87
|
},
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
function isTabItem(item: unknown): item is TabItem {
|
|
92
|
-
if (item && typeof item === 'object' && 'label' in item) {
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
91
|
const groupIdPrefix = 'rspress.tabs.';
|
|
99
92
|
|
|
100
93
|
export const Tabs = forwardRef(
|
|
@@ -102,6 +95,7 @@ export const Tabs = forwardRef(
|
|
|
102
95
|
const {
|
|
103
96
|
values,
|
|
104
97
|
defaultIndex,
|
|
98
|
+
defaultValue,
|
|
105
99
|
onChange,
|
|
106
100
|
children: rawChildren,
|
|
107
101
|
groupId,
|
|
@@ -118,9 +112,9 @@ export const Tabs = forwardRef(
|
|
|
118
112
|
isValidElement(child),
|
|
119
113
|
) as unknown as ReactElement<TabProps>[];
|
|
120
114
|
|
|
121
|
-
const tabValues:
|
|
115
|
+
const tabValues: ResolvedTabItem[] = useMemo(() => {
|
|
122
116
|
return getTabValuesFromChildren(children, values);
|
|
123
|
-
}, [
|
|
117
|
+
}, [children, values]);
|
|
124
118
|
|
|
125
119
|
if (process.env.__SSR_MD__) {
|
|
126
120
|
return (
|
|
@@ -138,11 +132,18 @@ export const Tabs = forwardRef(
|
|
|
138
132
|
);
|
|
139
133
|
}
|
|
140
134
|
|
|
141
|
-
const
|
|
135
|
+
const defaultValueIndex =
|
|
136
|
+
defaultValue !== undefined
|
|
137
|
+
? tabValues.findIndex(item => item.value === defaultValue)
|
|
138
|
+
: -1;
|
|
139
|
+
const initialActiveIndex =
|
|
140
|
+
defaultValueIndex === -1 ? (defaultIndex ?? 0) : defaultValueIndex;
|
|
141
|
+
|
|
142
|
+
const [activeIndex, setActiveIndex] = useState(initialActiveIndex);
|
|
142
143
|
|
|
143
144
|
const [storageIndex, setStorageIndex] = useStorageValue<string>(
|
|
144
145
|
`${groupIdPrefix}${groupId}`,
|
|
145
|
-
|
|
146
|
+
initialActiveIndex.toString(),
|
|
146
147
|
);
|
|
147
148
|
|
|
148
149
|
const currentIndex: number = groupId ? Number(storageIndex) : activeIndex;
|
|
@@ -157,11 +158,11 @@ export const Tabs = forwardRef(
|
|
|
157
158
|
tabPosition === 'center' ? 'center' : 'flex-start',
|
|
158
159
|
}}
|
|
159
160
|
>
|
|
160
|
-
{tabValues.map(({ label }, index) => {
|
|
161
|
+
{tabValues.map(({ label, value, disabled }, index) => {
|
|
161
162
|
const isActive = index === currentIndex;
|
|
162
163
|
return (
|
|
163
164
|
<div
|
|
164
|
-
key={
|
|
165
|
+
key={value ?? index}
|
|
165
166
|
className={clsx(
|
|
166
167
|
'rp-tabs__label__item',
|
|
167
168
|
isActive
|
|
@@ -171,6 +172,9 @@ export const Tabs = forwardRef(
|
|
|
171
172
|
)}
|
|
172
173
|
data-index={index}
|
|
173
174
|
onClick={() => {
|
|
175
|
+
if (disabled) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
174
178
|
onChange?.(index);
|
|
175
179
|
if (groupId) {
|
|
176
180
|
setStorageIndex(index.toString());
|
|
@@ -186,7 +190,7 @@ export const Tabs = forwardRef(
|
|
|
186
190
|
</div>
|
|
187
191
|
) : null}
|
|
188
192
|
<div className="rp-tabs__content">
|
|
189
|
-
{tabValues.map(({
|
|
193
|
+
{tabValues.map(({ value, content }, index) => {
|
|
190
194
|
const isActive = index === currentIndex;
|
|
191
195
|
if (!keepDOM && !isActive) {
|
|
192
196
|
return null;
|
|
@@ -194,7 +198,7 @@ export const Tabs = forwardRef(
|
|
|
194
198
|
|
|
195
199
|
return (
|
|
196
200
|
<div
|
|
197
|
-
key={
|
|
201
|
+
key={value ?? index}
|
|
198
202
|
className={clsx(
|
|
199
203
|
'rp-tabs__content__item',
|
|
200
204
|
isActive
|
|
@@ -217,7 +221,10 @@ export const Tabs = forwardRef(
|
|
|
217
221
|
|
|
218
222
|
Tabs.displayName = 'Tabs';
|
|
219
223
|
|
|
220
|
-
export type TabProps =
|
|
224
|
+
export type TabProps = {
|
|
225
|
+
label?: ReactNode;
|
|
226
|
+
value?: string;
|
|
227
|
+
disabled?: boolean;
|
|
221
228
|
children: ReactNode;
|
|
222
229
|
};
|
|
223
230
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addTrailingSlash, node_path, addLeadingSlash } from "../
|
|
1
|
+
import { addTrailingSlash, node_path, addLeadingSlash } from "../2235.js";
|
|
2
2
|
import { createError } from "./utils/error.js";
|
|
3
3
|
import { haveNavSidebarConfig as auto_nav_sidebar_haveNavSidebarConfig } from "./auto-nav-sidebar/index.js";
|
|
4
4
|
class PluginDriver {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../
|
|
1
|
+
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../2235.js";
|
|
2
2
|
import { processLocales, combineWalkResult } from "./locales.js";
|
|
3
3
|
import { walk } from "./walk.js";
|
|
4
4
|
async function runAutoNavSide(config, metaFileSet, mdFileSet) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type SidebarDivider, type SidebarGroup, type SidebarItem, type SidebarSectionHeader } from '@rspress/shared';
|
|
2
|
-
declare function scanSideMeta(workDir: string, docsDir: string, extensions: string[], metaFileSet: Set<string>, mdFileSet: Set<string>): Promise<(
|
|
2
|
+
declare function scanSideMeta(workDir: string, docsDir: string, extensions: string[], metaFileSet: Set<string>, mdFileSet: Set<string>): Promise<(SidebarDivider | SidebarGroup | SidebarItem | SidebarSectionHeader)[]>;
|
|
3
3
|
export { scanSideMeta };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
2
|
import "../../8006.js";
|
|
3
|
-
import { extname, logger, promises_readdir, external_node_path_relative, isExternalUrl, slash, promises_stat, join } from "../../
|
|
3
|
+
import { extname, logger, promises_readdir, external_node_path_relative, isExternalUrl, slash, promises_stat, join } from "../../2235.js";
|
|
4
4
|
import { createError } from "../utils/error.js";
|
|
5
5
|
import { PUBLIC_DIR } from "../constants.js";
|
|
6
6
|
import { pathExists, extractInfoFromFrontmatterWithAbsolutePath, readJson } from "./utils.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../
|
|
1
|
+
import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../2235.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
3
|
async function pathExists(path) {
|
|
4
4
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isExternalUrl, node_path, promises } from "../../
|
|
1
|
+
import { isExternalUrl, node_path, promises } from "../../2235.js";
|
|
2
2
|
import { pathExists } from "../utils/fs.js";
|
|
3
3
|
import { readJson } from "./utils.js";
|
|
4
4
|
import { addRoutePrefix } from "../route/RoutePage.js";
|
package/dist/node/initRsbuild.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { external_node_process_cwd, node_path, external_node_url_fileURLToPath, addTrailingSlash, PLUGIN_REACT_NAME, external_node_module_createRequire, removeTrailingSlash, pluginVirtualModule, pluginReact, MDX_OR_MD_REGEXP } from "../
|
|
1
|
+
import { external_node_process_cwd, node_path, external_node_url_fileURLToPath, addTrailingSlash, PLUGIN_REACT_NAME, external_node_module_createRequire, removeTrailingSlash, pluginVirtualModule, pluginReact, MDX_OR_MD_REGEXP } from "../2235.js";
|
|
2
2
|
import { createError } from "./utils/error.js";
|
|
3
3
|
import { PUBLIC_DIR, CSR_CLIENT_ENTRY, SSR_CLIENT_ENTRY, OUTPUT_DIR, SSG_MD_SERVER_ENTRY, inlineThemeScript, NODE_SSG_BUNDLE_FOLDER, isProduction, PACKAGE_ROOT, SSR_SERVER_ENTRY, TEMPLATE_PATH, NODE_SSG_MD_BUNDLE_FOLDER, DEFAULT_THEME, NODE_SSG_MD_BUNDLE_NAME, DEFAULT_TITLE, NODE_SSG_BUNDLE_NAME } from "./constants.js";
|
|
4
4
|
import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
const SHIKI_TRANSFORMER_ADD_TITLE = 'shiki-transformer:add-title';
|
|
2
|
+
const TITLE_META_REGEX = /(?:^|\s)title=(?:"([^"]*)"|'([^']*)'|`([^`]*)`|([^\s]+))(?=\s|$)/;
|
|
2
3
|
function parseTitleFromMeta(meta) {
|
|
3
4
|
if (!meta) return '';
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const [k, v = ''] = item.split('=').filter(Boolean);
|
|
7
|
-
if ('title' === k && v.length > 0) return v.replace(/["'`]/g, '');
|
|
8
|
-
}
|
|
9
|
-
return '';
|
|
5
|
+
const matched = meta.match(TITLE_META_REGEX);
|
|
6
|
+
return matched?.slice(1).find(Boolean) ?? '';
|
|
10
7
|
}
|
|
11
8
|
function transformerAddTitle() {
|
|
12
9
|
return {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { Root } from 'mdast';
|
|
15
15
|
import type { Plugin } from 'unified';
|
|
16
|
-
export declare const DIRECTIVE_TYPES: readonly [
|
|
16
|
+
export declare const DIRECTIVE_TYPES: readonly ['tip', 'note', 'warning', 'caution', 'danger', 'info', 'details'];
|
|
17
17
|
export declare const REGEX_BEGIN: RegExp;
|
|
18
18
|
export declare const REGEX_END: RegExp;
|
|
19
19
|
export declare const REGEX_GH_BEGIN: RegExp;
|
|
@@ -3,6 +3,6 @@ import type { Root } from 'mdast';
|
|
|
3
3
|
import type { VFile } from 'vfile';
|
|
4
4
|
export declare const remarkImage: ({ docDirectory, remarkImageOptions, lint, }: {
|
|
5
5
|
docDirectory: string;
|
|
6
|
-
remarkImageOptions?: MarkdownOptions[
|
|
6
|
+
remarkImageOptions?: MarkdownOptions['image'];
|
|
7
7
|
lint?: boolean;
|
|
8
8
|
}) => (tree: Root, file: VFile) => void;
|
|
@@ -79,6 +79,7 @@ const remarkImage = ({ docDirectory, remarkImageOptions, lint })=>(tree, file)=>
|
|
|
79
79
|
const { alt, url } = node;
|
|
80
80
|
if (!url) return;
|
|
81
81
|
if (shouldCheckDeadImages) resolveImage(url, file.path, docDirectory, deadImages);
|
|
82
|
+
if (lint) return;
|
|
82
83
|
const imagePath = normalizeImageUrl(url);
|
|
83
84
|
if (!imagePath) return;
|
|
84
85
|
const tempVariableName = `image${images.length}`;
|
|
@@ -10,7 +10,7 @@ import type { RouteService } from '../../route/RouteService.js';
|
|
|
10
10
|
export declare const remarkLink: ({ cleanUrls, routeService, remarkLinkOptions, lint, __base, }: {
|
|
11
11
|
cleanUrls: boolean | string;
|
|
12
12
|
routeService: RouteService | null;
|
|
13
|
-
remarkLinkOptions?: MarkdownOptions[
|
|
13
|
+
remarkLinkOptions?: MarkdownOptions['link'];
|
|
14
14
|
lint?: boolean;
|
|
15
15
|
__base?: string;
|
|
16
16
|
}) => (tree: Root, file: VFile) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../
|
|
1
|
+
import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../2235.js";
|
|
2
2
|
import { PUBLIC_DIR } from "../constants.js";
|
|
3
3
|
import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
|
|
4
4
|
import { createError } from "../utils/error.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unified, node_path, promises, loadFrontMatter, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../
|
|
1
|
+
import { unified, node_path, promises, loadFrontMatter, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../2235.js";
|
|
2
2
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
3
3
|
import { flattenMdxContent } from "../utils/flattenMdxContent.js";
|
|
4
4
|
import { importStatementRegex } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../
|
|
1
|
+
import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../2235.js";
|
|
2
2
|
const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
|
|
3
3
|
const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
|
|
4
4
|
return [
|