Skip to content

Commit

Permalink
docs: improve markdown code blocks note
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Jul 15, 2024
1 parent 5cfa771 commit 499ba20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions docs/guide/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ Config reference: [markdown.toc](../reference/config.md#markdown-toc)

Following code blocks extensions are implemented during markdown parsing in Node side. That means, the code blocks won't be processed in client side.

Notice that some of the code blocks features require theme support. The default theme of VuePress supports all of them, but community themes might not. You'd better check the theme documentation before using them.

#### Code Title

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.
You can specify the title of the code block by adding a `title` key-value mark in your fenced code blocks.

**Input**

Expand Down Expand Up @@ -196,7 +198,7 @@ It can be used in combination with the other marks below. Please leave a space b

#### Line Highlighting

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 can highlight specified lines of your code blocks by adding line ranges mark in your fenced code blocks.

**Input**

Expand Down Expand Up @@ -246,7 +248,7 @@ Config reference: [markdown.code.highlightLines](../reference/config.md#markdown

You must have noticed that the number of lines is displayed on the left side of code blocks.

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.
You can add `:line-numbers` / `:no-line-numbers` mark in your fenced code blocks to override the value set in config.

**Input**

Expand Down
8 changes: 5 additions & 3 deletions docs/zh/guide/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@ Emoji 扩展由 [markdown-it-emoji](https://github.com/markdown-it/markdown-it-e

下列代码块扩展是在 Node 端进行 Markdown 解析的时候实现的。这意味着代码块并不会在客户端被处理。

需要注意的是,部分代码块功能需要主题支持。VuePress 默认主题支持所有这些功能,但社区主题有可能不支持。请查看你使用的主题文档来确认是否支持这些功能。

#### 代码标题

你可以在代码块添加一个 `title` 键值对来为代码块设置标题。提示:需要主题支持。
你可以在代码块添加一个 `title` 键值对来为代码块设置标题。

**Input**

Expand Down Expand Up @@ -197,7 +199,7 @@ export default defineUserConfig({

#### 行高亮

你可以在代码块添加行数范围标记,来为对应代码行进行高亮。提示:它需要高亮器插件和主题支持。
你可以在代码块添加行数范围标记,来为对应代码行进行高亮。

**输入**

Expand Down Expand Up @@ -245,7 +247,7 @@ export default defineUserConfig({

#### 行号

你肯定已经注意到在代码块的最左侧会展示行号。这个功能是默认启用的,你可以通过配置来禁用它。提示:它需要高亮器插件和主题支持。
你肯定已经注意到在代码块的最左侧会展示行号。这个功能是默认启用的,你可以通过配置来禁用它。

你可以在代码块添加 `:line-numbers` / `:no-line-numbers` 标记来覆盖配置项中的设置。

Expand Down

0 comments on commit 499ba20

Please sign in to comment.