Skip to content

Commit b9d6ccf

Browse files
i18n(zh-cn): Update some integrations-guide (#12456)
Co-authored-by: Yan <[email protected]>
1 parent 59f9d1a commit b9d6ccf

File tree

5 files changed

+79
-15
lines changed

5 files changed

+79
-15
lines changed

src/content/docs/zh-cn/guides/integrations-guide/markdoc.mdx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ category: other
99
i18nReady: true
1010
---
1111

12-
import { FileTree } from '@astrojs/starlight/components';
12+
import { FileTree, Steps } from '@astrojs/starlight/components';
1313
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
14-
import { Steps } from '@astrojs/starlight/components';
1514
import ReadMore from '~/components/ReadMore.astro';
15+
import Since from '~/components/Since.astro';
1616

1717
这个 **[Astro 集成][astro-integration]** 允许使用 [Markdoc](https://markdoc.dev/) 来创建组件、页面和内容集合条目。
1818

@@ -585,6 +585,13 @@ Astro Markdoc 集成处理了在 `markdoc.config.js` 文件中不可用的 Markd
585585
586586
### `allowHTML`
587587
588+
<p>
589+
590+
**类型:** `boolean`<br />
591+
**默认值:** `false`<br />
592+
<Since v="0.4.4" pkg="@astrojs/markdoc" />
593+
</p>
594+
588595
允许在 Markdoc 标签和节点旁边编写 HTML 标记。
589596
590597
默认情况下,Markdoc 不会将 HTML 标记识别为语义内容。
@@ -607,6 +614,13 @@ Astro Markdoc 集成处理了在 `markdoc.config.js` 文件中不可用的 Markd
607614
608615
### `ignoreIndentation`
609616
617+
<p>
618+
619+
**类型:** `boolean`<br />
620+
**默认值:** `false`<br />
621+
<Since v="0.7.0" pkg="@astrojs/markdoc" />
622+
</p>
623+
610624
默认情况下,任何使用四个空格缩进的内容都会被视为代码块。不幸的是,这种行为使得在具有复杂结构的文档中用任意级别的缩进来提高可读性变得困难。
611625
612626
在使用 Markdoc 的嵌套标签时,将标签内的内容缩进可以帮助清楚地显示层级深度。为了支持任意缩进,我们需要禁用基于缩进的代码块,并修改几个其他的 markdown-it 解析规则,以忽略缩进的代码块。即通过启用 ignoreIndentation 选项可以应用这些修改。

src/content/docs/zh-cn/guides/integrations-guide/mdx.mdx

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,12 @@ MDX 不支持以字符串形式传递备注和 rehype 插件。你应该安装
270270

271271
### `extendMarkdownConfig`
272272

273-
* **类型:** `boolean`
274-
* **默认值:** `true`
273+
<p>
274+
275+
**类型:** `boolean`<br />
276+
**默认值:** `true`<br />
277+
<Since v="0.15.0" pkg="@astrojs/mdx" />
278+
</p>
275279

276280
MDX 将默认扩展[你的项目现有的 Markdown 配置](/zh-cn/reference/configuration-reference/#markdown-选项)。要覆盖个别选项,你可以在你的 MDX 配置中进行等价配置。
277281

@@ -325,13 +329,26 @@ export default defineConfig({
325329

326330
### `recmaPlugins`
327331

332+
333+
<p>
334+
335+
**类型:** `PluggableList`<br />
336+
**默认值:** `[]`<br />
337+
<Since v="0.11.5" pkg="@astrojs/mdx" />
338+
</p>
339+
328340
这些是直接修改输出 [estree](https://github.com/estree/estree) 的插件。这对于在你的 MDX 文件中修改或注入 JavaScript 变量很有用。
329341

330342
我们建议[使用 AST Explorer](https://astexplorer.net/)来处理 estree 的输出,并尝试 [`estree-util-visit`](https://unifiedjs.com/explore/package/estree-util-visit/) 来搜索整个 JavaScript 节点。
331343

332344
### optimize
333345

334-
* **类型:** `boolean | { ignoreElementNames?: string[] }`
346+
<p>
347+
348+
**类型:** `boolean | { ignoreElementNames?: string[] }`<br />
349+
**默认值:** `false`<br />
350+
<Since v="0.19.5" pkg="@astrojs/mdx" />
351+
</p>
335352

336353
这是一个可选的配置设置,用于优化 MDX 输出,以便通过内部 rehype 插件加快构建和渲染速度。如果你的 MDX 文件较多,并注意到构建速度较慢,这可能会很有用。不过,该选项可能会生成一些未转义的 HTML,因此请确保你网站的交互式部分在启用该选项后仍能正常工作。
337354

@@ -353,7 +370,11 @@ export default defineConfig({
353370

354371
#### ignoreElementNames
355372

356-
* **类型:** `string[]`
373+
<p>
374+
375+
**类型:** `string[]`<br />
376+
<Since v="3.0.0" pkg="@astrojs/mdx" />
377+
</p>
357378

358379
<p><Since pkg="@astrojs/mdx" v="3.0.0" /></p>
359380
以前称为 `customComponentNames`

src/content/docs/zh-cn/guides/integrations-guide/preact.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ Astro Preact 集成处理了 Preact 组件的渲染,并具有自己的选项
132132

133133
对于基本用法,你无需配置 Preact 集成。
134134

135-
### 兼容
135+
### `compat`
136+
137+
<p>
138+
139+
**类型:** `boolean`<br />
140+
<Since pkg="@astrojs/preact" v="0.3.0" />
141+
</p>
136142

137143
你可以启用 `preact/compat`,这是 Preact 的兼容层,用于在不需要安装或将 React 的较大库发送到用户的网络浏览器的情况下渲染 React 组件。
138144

@@ -166,9 +172,13 @@ export default defineConfig({
166172
目前,`compat` 选项只适用于 React 库,将代码以 ESM 的形式导出。如果在构建时出现错误,请尝试将该库添加到你的`vite.ssr.noExternal: ['the-react-library']``astro.config.mjs` 文件中。
167173
:::
168174

169-
### 开发者工具
175+
### `devtools`
170176

171-
<p><Since pkg="@astrojs/preact" v="3.3.0" /></p>
177+
<p>
178+
179+
**类型:** `boolean`<br />
180+
<Since pkg="@astrojs/preact" v="3.3.0" />
181+
</p>
172182

173183
你可以通过在开发中向你的 `preact()` 集成配置传递一个包含 `devtools: true` 的对象来启用 [Preact 开发者工具](https://preactjs.github.io/preact-devtools/)
174184

src/content/docs/zh-cn/guides/integrations-guide/solid-js.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ export default defineConfig({
117117

118118
## 配置
119119

120-
### 开发者工具
120+
### `devtools`
121121

122-
<p><Since pkg="@astrojs/solid-js" v="4.2.0" /></p>
122+
<p>
123+
124+
**类型:** `boolean`<br />
125+
<Since pkg="@astrojs/solid-js" v="4.2.0" />
126+
</p>
123127

124128
在开发中,你可以通过向你的 `solid()` 集成配置传递一个包含 `devtools: true` 的对象,并将 `solid-devtools` 添加到你的项目依赖中,来启用 [Solid 开发者工具](https://github.com/thetarnav/solid-devtools)
125129

src/content/docs/zh-cn/guides/integrations-guide/vue.mdx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,13 @@ export default defineConfig({
140140
});
141141
```
142142

143-
### appEntrypoint
143+
### `appEntrypoint`
144+
145+
<p>
146+
147+
**类型:** `string`<br />
148+
<Since pkg="@astrojs/vue" v="1.2.0" />
149+
</p>
144150

145151
你可以拓展 Vue `app` 实例并将 `appEntrypoint` 选项设置为一个相对根目录的导入标识符 (例如: `appEntrypoint: "/src/pages/_app"`)。
146152

@@ -165,7 +171,13 @@ export default (app: App) => {
165171
};
166172
```
167173

168-
### jsx
174+
### `jsx`
175+
176+
<p>
177+
178+
**类型:** `boolean | object`<br />
179+
<Since pkg="@astrojs/vue" v="1.2.0" />
180+
</p>
169181

170182
你可以通过设置 `jsx: true` 来使用 Vue JSX。
171183

@@ -197,9 +209,12 @@ export default defineConfig({
197209
],
198210
});
199211
```
200-
### 开发者工具
212+
### `devtools`
201213

202-
<p><Since pkg="@astrojs/vue" v="4.2.0" /></p>
214+
<p>
215+
**类型:** `boolean | object`<br />
216+
<Since pkg="@astrojs/vue" v="4.2.0" />
217+
</p>
203218

204219
你可以在开发中通过在 `vue()` 集成配置中传递一个对象 `devtools: true` 来启用 [Vue DevTools](https://devtools-next.vuejs.org/)
205220

0 commit comments

Comments
 (0)