Skip to content

Commit 8f3aab1

Browse files
committed
docs: add tips about plugins deduplication
1 parent 742f581 commit 8f3aab1

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

docs/guide/plugin.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ You can use either plugin name or its shorthand:
2525
| `@org/vuepress-plugin-bar`| `@org/bar` |
2626
| `@vuepress/plugin-foobar` | `@vuepress/foobar` |
2727

28+
::: tip
29+
Most plugins can only be used once. If the same plugin is used multiple times, only the last one will take effect.
30+
31+
However, some plugins can be used multiple times (e.g. [@vuepress/plugin-container](../reference/plugin/container.md)), and you should check the documentation of the plugin itself for detailed guide.
32+
:::
33+
2834
## Local Plugin
2935

3036
If you want to use your own plugin but don't want to publish it, you can create a local plugin.

docs/reference/plugin/container.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ The [Custom Containers](../default-theme/markdown.md#custom-containers) of defau
2020
- The `info` is optional, and the default value can be specified via `defaultInfo` in [locales](#locales) option.
2121
- The `content` can be any valid markdown content.
2222

23+
::: tip
24+
This plugin can be used multiple times to support different types of containers.
25+
:::
26+
2327
## Options
2428

2529
### type

docs/zh/guide/plugin.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ module.exports = {
2525
| `@org/vuepress-plugin-bar`| `@org/bar` |
2626
| `@vuepress/plugin-foobar` | `@vuepress/foobar` |
2727

28+
::: tip
29+
大部分插件只能使用一次,如果同一个插件被多次使用,那么只有最后一次会生效。
30+
31+
然而,部分插件是可以被多次使用的(例如 [@vuepress/plugin-container](../reference/plugin/container.md)),你应该查看插件本身的文档来获取详细指引。
32+
:::
33+
2834
## 本地插件
2935

3036
如果你想要使用自己的插件,但是又不想发布它,你可以创建一个本地插件。

docs/zh/reference/plugin/container.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
- `info` 是可选的,其默认值可以通过 [locales](#locales)`defaultInfo` 配置项来指定。
2121
- `content` 可是任何合法的 Markdown 内容。
2222

23+
::: tip
24+
该插件可以被多次使用,以便支持不同类型的容器。
25+
:::
26+
2327
## 配置项
2428

2529
### type

0 commit comments

Comments
 (0)