File tree 7 files changed +97
-1
lines changed
7 files changed +97
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ https://vuepress.vuejs.org/
23
23
* [ Table of Contents] ( https://vuepress.vuejs.org/guide/markdown.html#table-of-contents )
24
24
* [ Custom Containers] ( https://vuepress.vuejs.org/guide/markdown.html#custom-containers )
25
25
* [ Line Highlighting] ( https://vuepress.vuejs.org/guide/markdown.html#line-highlighting-in-code-blocks )
26
- * [ line Numbers] ( https://vuepress.vuejs.org/config/# markdown-linenumbers )
26
+ * [ Line Numbers] ( https://vuepress.vuejs.org/guide/ markdown.html#line-numbers )
27
27
* [ Import Code Snippets] ( https://vuepress.vuejs.org/guide/markdown.html#import-code-snippets )
28
28
29
29
** Using Vue in Markdown**
Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ Provide config options to the used theme. The options will vary depending on the
145
145
146
146
Whether to show line numbers to the left of each code blocks.
147
147
148
+ ** Also see:**
149
+
150
+ - [ Line Numbers] ( ../guide/markdown.md#line-numbers )
151
+
148
152
### markdown.slugify
149
153
150
154
- Type: ` Function `
Original file line number Diff line number Diff line change @@ -224,6 +224,50 @@ export default {
224
224
}
225
225
```
226
226
227
+ ## Line Numbers
228
+
229
+ You can enable line numbers for each code blocks via config:
230
+
231
+ ``` js
232
+ module .exports = {
233
+ markdown: {
234
+ lineNumbers: true
235
+ }
236
+ }
237
+ ```
238
+
239
+ <!-- TODO Support line numbers for specific fence block -->
240
+
241
+ - Demo:
242
+
243
+ <picture >
244
+ <source srcset =" /line-numbers-desktop.png " media =" (min-width: 719px) " >
245
+ <img class =" line-numbers-desktop-snap " alt =" Image " >
246
+ </picture >
247
+
248
+ <picture >
249
+ <source srcset =" /line-numbers-mobile.gif " media =" (max-width: 719px) " >
250
+ <img class =" line-numbers-mobile-snap " alt =" Image " >
251
+ </picture >
252
+
253
+ <style >
254
+ @media screen and (min-width : 719px ) {
255
+ .line-numbers-mobile-snap {
256
+ display : none ;
257
+ }
258
+ }
259
+ @media screen and (max-width : 719px ) {
260
+ .line-numbers-desktop-snap {
261
+ display : none ;
262
+ }
263
+ .line-numbers-mobile-snap {
264
+ max-width : none !important ;
265
+ margin : 0 -1.5rem ;
266
+ width : 100vw ;
267
+ }
268
+ }
269
+ </style >
270
+
227
271
## Import Code Snippets <Badge text =" Experimental " type =" warn " /> <Badge text =" 0.10.1+ " type =" tip " />
228
272
229
273
You can import code snippets from existing files via following syntax:
Original file line number Diff line number Diff line change @@ -144,6 +144,10 @@ module.exports = {
144
144
145
145
是否在每个代码块的左侧显示行号。
146
146
147
+ ** Also see:**
148
+
149
+ - [ 行号] ( ../guide/markdown.md#行号 )
150
+
147
151
### markdown.anchor
148
152
149
153
- 类型: ` Object `
Original file line number Diff line number Diff line change @@ -222,6 +222,50 @@ export default {
222
222
}
223
223
```
224
224
225
+ ## 行号
226
+
227
+ 你可以通过配置来为每个代码块显示行号:
228
+
229
+ ``` js
230
+ module .exports = {
231
+ markdown: {
232
+ lineNumbers: true
233
+ }
234
+ }
235
+ ```
236
+
237
+ <!-- TODO Support line numbers for specific fence block -->
238
+
239
+ - 示例:
240
+
241
+ <picture >
242
+ <source srcset =" /line-numbers-desktop.png " media =" (min-width: 719px) " >
243
+ <img class =" line-numbers-desktop-snap " alt =" Image " >
244
+ </picture >
245
+
246
+ <picture >
247
+ <source srcset =" /line-numbers-mobile.gif " media =" (max-width: 719px) " >
248
+ <img class =" line-numbers-mobile-snap " alt =" Image " >
249
+ </picture >
250
+
251
+ <style >
252
+ @media screen and (min-width : 719px ) {
253
+ .line-numbers-mobile-snap {
254
+ display : none ;
255
+ }
256
+ }
257
+ @media screen and (max-width : 719px ) {
258
+ .line-numbers-desktop-snap {
259
+ display : none ;
260
+ }
261
+ .line-numbers-mobile-snap {
262
+ max-width : none !important ;
263
+ margin : 0 -1.5rem ;
264
+ width : 100vw ;
265
+ }
266
+ }
267
+ </style >
268
+
225
269
## 导入代码段 <Badge text =" Experimental " type =" warn " /> <Badge text =" 0.10.1+ " type =" tip " />
226
270
227
271
你可以通过下述的语法导入已经存在的文件中的代码段:
You can’t perform that action at this time.
0 commit comments