Skip to content

Commit 72d7488

Browse files
shigmaulivz
authored andcommitted
docs: add refs to custom container (#1441)
1 parent b15b634 commit 72d7488

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

packages/docs/docs/guide/markdown.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ or
121121

122122
Rendering of TOC can be configured using the [`markdown.toc`](../config/README.md#markdown-toc) option, or as props of [TOC component](./using-vue.md#toc), like `<TOC list-type="ol" :include-level="[2, Infinity]"/>`.
123123

124-
## Custom Containers
124+
## Custom Containers <Badge text="default theme"/>
125125

126126
**Input**
127127

@@ -165,6 +165,10 @@ Danger zone, do not proceed
165165
Danger zone, do not proceed
166166
:::
167167

168+
**Also see:**
169+
170+
- [@vuepress/plugin-container](../plugin/official/plugin-container.md)
171+
168172
## Syntax Highlighting in Code Blocks
169173

170174
VuePress uses [Prism](https://prismjs.com/) to highlight language syntax in markdown code blocks, using coloured text. Prism supports a wide variety of programming languages. All you need to do is append a valid language alias to the beginning backticks for the code block:
@@ -291,7 +295,7 @@ module.exports = {
291295
}
292296
</style>
293297

294-
## Import Code Snippets <Badge text="beta" type="warn"/> <Badge text="0.10.1+" type="tip"/>
298+
## Import Code Snippets <Badge text="beta" type="warn"/>
295299

296300
You can import code snippets from existing files via following syntax:
297301

@@ -316,7 +320,7 @@ It also supports [line highlighting](#line-highlighting-in-code-blocks):
316320
<<< @/../@vuepress/markdown/__tests__/fragments/snippet.js{2}
317321

318322
::: tip
319-
Since the import of the code snippets will be executed before webpack compilation, you can't use the path alias in webpack. The default value of `@` is `process.cwd()`.
323+
Since the import of the code snippets will be executed before webpack compilation, you can't use the path alias in webpack. The default value of `@` is `process.cwd()`.
320324
:::
321325

322326

packages/docs/docs/zh/guide/markdown.md

+23-19
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ lang: en-US
6969

7070
## GitHub 风格的表格
7171

72-
**Input**
72+
**输入**
7373

7474
```
7575
| Tables | Are | Cool |
@@ -79,7 +79,7 @@ lang: en-US
7979
| zebra stripes | are neat | $1 |
8080
```
8181

82-
**Output**
82+
**输出**
8383

8484
| Tables | Are | Cool |
8585
| ------------- |:-------------:| -----:|
@@ -89,19 +89,19 @@ lang: en-US
8989

9090
## Emoji
9191

92-
**Input**
92+
**输入**
9393

9494
```
9595
:tada: :100:
9696
```
9797

98-
**Output**
98+
**输出**
9999

100100
:tada: :100:
101101

102102
## 目录
103103

104-
**Input**
104+
**输入**
105105

106106
```md
107107
[[toc]]
@@ -113,15 +113,15 @@ lang: en-US
113113
<TOC/>
114114
```
115115

116-
**Output**
116+
**输出**
117117

118118
[[toc]]
119119

120120
目录(Table of Contents)的渲染可以通过 [`markdown.toc`](../config/README.md#markdown-toc) 选项来配置,也可以在 [TOC 组件](./using-vue.md#toc)中直接传入,如 `<TOC list-type="ol" :include-level="[2, Infinity]"/>`
121121

122-
## 自定义容器
122+
## 自定义容器 <Badge text="默认主题"/>
123123

124-
**Input**
124+
**输入**
125125

126126
```
127127
::: tip
@@ -137,7 +137,7 @@ This is a dangerous warning
137137
:::
138138
```
139139

140-
**Output**
140+
**输出**
141141

142142
::: tip
143143
This is a tip
@@ -163,11 +163,15 @@ Danger zone, do not proceed
163163
Danger zone, do not proceed
164164
:::
165165

166+
**参考:**
167+
168+
- [@vuepress/plugin-container](../plugin/official/plugin-container.md)
169+
166170
## 代码块中的语法高亮
167171

168172
VuePress 使用了 [Prism](https://prismjs.com/) 来为 markdown 中的代码块实现语法高亮。Prism 支持大量的编程语言,你需要做的只是在代码块的开始倒勾中附加一个有效的语言别名:
169173

170-
**Input**
174+
**输入**
171175

172176
````
173177
``` js
@@ -178,7 +182,7 @@ export default {
178182
```
179183
````
180184

181-
**Output**
185+
**输出**
182186

183187
``` js
184188
export default {
@@ -187,7 +191,7 @@ export default {
187191
}
188192
```
189193

190-
**Input**
194+
**输入**
191195

192196
````
193197
``` html
@@ -202,7 +206,7 @@ export default {
202206
```
203207
````
204208

205-
**Output**
209+
**输出**
206210

207211
``` html
208212
<ul>
@@ -220,7 +224,7 @@ export default {
220224

221225
## 代码块中的行高亮
222226

223-
**Input**
227+
**输入**
224228

225229
````
226230
``` js {4}
@@ -234,7 +238,7 @@ export default {
234238
```
235239
````
236240

237-
**Output**
241+
**输出**
238242

239243
``` js{4}
240244
export default {
@@ -290,7 +294,7 @@ module.exports = {
290294
}
291295
</style>
292296

293-
## 导入代码段 <Badge text="beta" type="warn"/> <Badge text="0.10.1+" type="tip"/>
297+
## 导入代码段 <Badge text="beta" type="warn"/>
294298

295299
你可以通过下述的语法导入已经存在的文件中的代码段:
296300

@@ -304,18 +308,18 @@ module.exports = {
304308
<<< @/filepath{highlightLines}
305309
```
306310

307-
**Input**
311+
**输入**
308312

309313
```
310314
<<< @/../@vuepress/markdown/__tests__/fragments/snippet.js{2}
311315
```
312316

313-
**Output**
317+
**输出**
314318

315319
<<< @/../@vuepress/markdown/__tests__/fragments/snippet.js{2}
316320

317321
::: tip 注意
318-
由于代码段的导入将在 webpack 编译之前执行,因此你无法使用 webpack 中的路径别名,此处的 `@` 默认值是 `process.cwd()`
322+
由于代码段的导入将在 webpack 编译之前执行,因此你无法使用 webpack 中的路径别名,此处的 `@` 默认值是 `process.cwd()`
319323
:::
320324

321325
## 进阶配置

0 commit comments

Comments
 (0)