You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/markdown.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -158,7 +158,7 @@ Following code blocks extensions are implemented during markdown parsing in Node
158
158
159
159
#### Code Title
160
160
161
-
You can specify the title of the code block by adding a `title` key-value mark in your fenced code blocks.
161
+
You can specify the title of the code block by adding a `title` key-value mark in your fenced code blocks. Note: This requires theme support.
162
162
163
163
**Input**
164
164
@@ -196,7 +196,7 @@ It can be used in combination with the other marks below. Please leave a space b
196
196
197
197
#### Line Highlighting
198
198
199
-
You can highlight specified lines of your code blocks by adding line ranges mark in your fenced code blocks:
199
+
You can highlight specified lines of your code blocks by adding line ranges mark in your fenced code blocks. Note: This requires highlighter plugin and theme support.
You must have noticed that the number of lines is displayed on the left side of code blocks. This is enabled by default and you can disable it in config.
247
+
You must have noticed that the number of lines is displayed on the left side of code blocks.
248
248
249
-
You can add `:line-numbers` / `:no-line-numbers` mark in your fenced code blocks to override the value set in config.
249
+
You can add `:line-numbers` / `:no-line-numbers` mark in your fenced code blocks to override the value set in config. Note: This requires highlighter plugin and theme support.
Copy file name to clipboardExpand all lines: docs/guide/migration.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -145,9 +145,9 @@ Renamed to `pagePatterns`
145
145
146
146
#### markdown.lineNumbers
147
147
148
-
Moved to [markdown.code.lineNumbers](../reference/config.md#markdown-code-linenumbers).
148
+
Removed.
149
149
150
-
Default value is changed from `false` to `true`.
150
+
The same feature is implemented in [@vuepress/plugin-prismjs][prismjs] and [@vuepress/plugin-shiki][shiki].
151
151
152
152
#### markdown.pageSuffix
153
153
@@ -414,7 +414,7 @@ Some major breaking changes:
414
414
- Always provide a valid js entry file, and do not use `"main": "layouts/Layout.vue"` as the theme entry anymore.
415
415
-`themeConfig` is removed from user config and site data. To access the `themeConfig` as you would via `this.$site.themeConfig` in v1, we now recommend using the [@vuepress/plugin-theme-data](https://ecosystem.vuejs.press/plugins/theme-data.html) plugin and its `useThemeData` composition API.
416
416
- Stylus is no longer the default CSS pre-processor, and the stylus palette system is not embedded. If you still want to use similar palette system as v1, [@vuepress/plugin-palette](https://ecosystem.vuejs.press/plugins/palette.html) may help.
417
-
- Markdown code blocks syntax highlighting by Prism.js is not embedded by default. You can use either [@vuepress/plugin-prismjs](https://ecosystem.vuejs.press/plugins/prismjs.html) or [@vuepress/plugin-shiki](https://ecosystem.vuejs.press/plugins/shiki.html), or implement syntax highlighting in your own way.
417
+
- Markdown code blocks syntax highlighting by Prism.js is not embedded by default. You can use either [@vuepress/plugin-prismjs][prismjs] or [@vuepress/plugin-shiki][shiki], or implement syntax highlighting in your own way.
418
418
- For scalability concerns, `this.$site.pages` is not available any more. See [Advanced > Cookbook > Resolving Routes](../advanced/cookbook/resolving-routes.md) for how to retrieve pages data in v2.
419
419
420
420
For more detailed guide about how to write a theme in v2, see [Advanced > Writing a Theme](../advanced/theme.md).
@@ -438,3 +438,6 @@ You can still inherit a parent theme with `extends: parentTheme()`, which will e
438
438
You can refer to [Default Theme > Extending](https://ecosystem.vuejs.press/themes/default/extending.html) for how to extend default theme.
439
439
440
440
The `@theme` and `@parent-theme` aliases are removed by default, but you can still make a extendable theme with similar approach, see [Advanced > Cookbook > Making a Theme Extendable](../advanced/cookbook/making-a-theme-extendable.md).
- A `boolean` value is to enable line numbers or not.
440
-
- A `number` value is the minimum number of lines to enable line numbers. For example, if you set it to `4`, line numbers will only be enabled when your code block has at least 4 lines of code.
Enable the extra wrapper of the `<pre>` tag or not.
454
-
455
-
The wrapper is required by the `highlightLines` and `lineNumbers`. That means, if you disable `preWrapper`, the line highlighting and line numbers will also be disabled.
456
-
457
-
::: tip
458
-
You can disable it if you want to implement them in client side. For example, [Prismjs Line Highlight](https://prismjs.com/plugins/line-highlight/) or [Prismjs Line Numbers](https://prismjs.com/plugins/line-numbers/).
459
-
:::
460
-
461
-
#### markdown.code.vPre.block
462
-
463
-
- Type: `boolean`
464
-
465
-
- Default: `true`
466
-
467
-
- Details:
468
-
469
-
Add `v-pre` directive to `<pre>` tag of code block or not.
如果你想要在客户端来实现这些功能时,可以禁用该配置项。比如使用 [Prismjs Line Highlight](https://prismjs.com/plugins/line-highlight/) 或者 [Prismjs Line Numbers](https://prismjs.com/plugins/line-numbers/)。
0 commit comments