From 499ba20e3e22e3a1a2bbb726ec4bcb9fb70b115b Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Mon, 15 Jul 2024 16:32:32 +0800 Subject: [PATCH] docs: improve markdown code blocks note --- docs/guide/markdown.md | 8 +++++--- docs/zh/guide/markdown.md | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md index 06204786..e1195ba5 100644 --- a/docs/guide/markdown.md +++ b/docs/guide/markdown.md @@ -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** @@ -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** @@ -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** diff --git a/docs/zh/guide/markdown.md b/docs/zh/guide/markdown.md index 74857e2d..b287d59a 100644 --- a/docs/zh/guide/markdown.md +++ b/docs/zh/guide/markdown.md @@ -157,9 +157,11 @@ Emoji 扩展由 [markdown-it-emoji](https://github.com/markdown-it/markdown-it-e 下列代码块扩展是在 Node 端进行 Markdown 解析的时候实现的。这意味着代码块并不会在客户端被处理。 +需要注意的是,部分代码块功能需要主题支持。VuePress 默认主题支持所有这些功能,但社区主题有可能不支持。请查看你使用的主题文档来确认是否支持这些功能。 + #### 代码标题 -你可以在代码块添加一个 `title` 键值对来为代码块设置标题。提示:需要主题支持。 +你可以在代码块添加一个 `title` 键值对来为代码块设置标题。 **Input** @@ -197,7 +199,7 @@ export default defineUserConfig({ #### 行高亮 -你可以在代码块添加行数范围标记,来为对应代码行进行高亮。提示:它需要高亮器插件和主题支持。 +你可以在代码块添加行数范围标记,来为对应代码行进行高亮。 **输入** @@ -245,7 +247,7 @@ export default defineUserConfig({ #### 行号 -你肯定已经注意到在代码块的最左侧会展示行号。这个功能是默认启用的,你可以通过配置来禁用它。提示:它需要高亮器插件和主题支持。 +你肯定已经注意到在代码块的最左侧会展示行号。这个功能是默认启用的,你可以通过配置来禁用它。 你可以在代码块添加 `:line-numbers` / `:no-line-numbers` 标记来覆盖配置项中的设置。