@alauda/doom 0.16.2-alpha.1 → 0.16.2
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/lib/cli/translate.js
CHANGED
|
@@ -36,7 +36,14 @@ const DEFAULT_SYSTEM_PROMPT = `
|
|
|
36
36
|
* 灵雀云 -> Alauda
|
|
37
37
|
* 容器组 -> Pods
|
|
38
38
|
* global 集群 -> global cluster
|
|
39
|
-
-
|
|
39
|
+
- 如果存在下列注释,请保留不用翻译,更不要修改注释内容
|
|
40
|
+
- {/* release-notes-for-bugs */}
|
|
41
|
+
- <!-- release-notes-for-bugs -->
|
|
42
|
+
- 如果存在下列注释,请整体移除不要保留
|
|
43
|
+
- {/* reference-start */}
|
|
44
|
+
- {/* reference-end */}
|
|
45
|
+
- <!-- reference-start -->
|
|
46
|
+
- <!-- reference-end -->
|
|
40
47
|
- 翻译过程中务必保留原文中的 \\< 和 \\{ 转义字符不要做任何转义变更
|
|
41
48
|
- 翻译过程中不要破坏原有的 Markdown 格式,如 frontmatter, 代码块、列表、表格等,其中 frontmatter 的内容不用做任何翻译,只需要原样返回即可
|
|
42
49
|
|
|
@@ -106,7 +113,7 @@ export const translateCommand = new Command('translate')
|
|
|
106
113
|
if (!Object.hasOwn(LANGUAGE_CODES, source) ||
|
|
107
114
|
!Object.hasOwn(LANGUAGE_CODES, target) ||
|
|
108
115
|
source === target) {
|
|
109
|
-
|
|
116
|
+
logger.error(`Translate from language \`${cyan(source)}\` to \`${cyan(target)}\` is not supported.`);
|
|
110
117
|
process.exitCode = 1;
|
|
111
118
|
return;
|
|
112
119
|
}
|
|
@@ -115,7 +122,7 @@ export const translateCommand = new Command('translate')
|
|
|
115
122
|
const sourceDir = path.resolve(docsDir, source);
|
|
116
123
|
const targetDir = path.resolve(docsDir, target);
|
|
117
124
|
if (!(await pathExists(sourceDir, 'directory'))) {
|
|
118
|
-
|
|
125
|
+
logger.error(`The directory "${cyan(sourceDir)}" does not exist.`);
|
|
119
126
|
process.exitCode = 1;
|
|
120
127
|
return;
|
|
121
128
|
}
|
|
@@ -124,6 +131,11 @@ export const translateCommand = new Command('translate')
|
|
|
124
131
|
cwd: sourceDir,
|
|
125
132
|
onlyFiles: false,
|
|
126
133
|
});
|
|
134
|
+
if (matched.length === 0) {
|
|
135
|
+
logger.error(`No files matched by the glob patterns: ${globs.map((g) => `\`${cyan(g)}\``).join(', ')}`);
|
|
136
|
+
process.exitCode = 1;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
127
139
|
const sourceFilePaths = await Promise.all(matched.map(async (it) => {
|
|
128
140
|
const stat = await fs.stat(it);
|
|
129
141
|
if (stat.isDirectory()) {
|
|
@@ -112,7 +112,7 @@ export function Overview(props) {
|
|
|
112
112
|
}
|
|
113
113
|
return [];
|
|
114
114
|
}, [overviewSidebarGroups, routePath, frontmatter]);
|
|
115
|
-
return (_jsxs("div", { className: "overview-index mx-auto", children: [content, groups.map((group) => (_jsxs(Fragment, { children: [(!title || [title, defaultGroupTitle].includes(group.name)) &&
|
|
116
|
-
groups.length === 1 ? (_jsx("h2", { style: { paddingTop: 0 } })) : (_jsx("h2", { children: renderInlineMarkdown(group.name) })), _jsx("div", { className: classes.overviewGroups, children: group.items.map((item) => (_jsxs("div", { className: classes.overviewGroup, children: [_jsx("
|
|
115
|
+
return (_jsxs("div", { className: "overview-index doom-overview-index mx-auto", children: [content, groups.map((group) => (_jsxs(Fragment, { children: [(!title || [title, defaultGroupTitle].includes(group.name)) &&
|
|
116
|
+
groups.length === 1 ? (_jsx("h2", { style: { paddingTop: 0 } })) : (_jsx("h2", { children: renderInlineMarkdown(group.name) })), _jsx("div", { className: classes.overviewGroups, children: group.items.map((item) => (_jsxs("div", { className: classes.overviewGroup, children: [_jsx("h3", { style: { marginBottom: 8 }, children: _jsx(Link, { href: normalizeHref(item.link), children: renderInlineMarkdown(item.text) }) }), _jsx("div", { className: classes.overviewDescription, children: item.description }), _jsx("ul", { className: "list-none", children: item.headers?.map((header) => (_jsx("li", { className: `${classes.overviewGroupLi} ${classes[`level${header.depth}`]} first:mt-2`, children: _jsx(Link, { href: `${normalizeHref(item.link)}#${header.id}`, children: renderInlineMarkdown(header.text) }) }, header.id))) })] }, item.link))) })] }, group.name)))] }));
|
|
117
117
|
}
|
|
118
118
|
export default Overview;
|
package/package.json
CHANGED