CodeGroup

Mr.Hope ... 2022-1-22 Markdown
  • Codegroup
  • Markdown
Less than 1 minute

The plugin provides you code group support.

# Config







 





module.exports = {
  plugins: [
    [
      "md-enhance",
      {
        // adds code group support
        codegroup: true,
      },
    ],
  ],
};
1
2
3
4
5
6
7
8
9
10
11

# Usage

You need to use code-group container outside, and place only code-group-item container inside it.

You need to set title for each code-group-item container, and place one code block in each code-group-item container.

If you want some item be actived by default, you can append a :active suffix at the end of title.

# Demo

:::: code-group

::: code-group-item yarn

```bash
yarn add -D vuepress-theme-hope
```

:::

::: code-group-item npm:active

```bash
npm i -D vuepress-theme-hope
```

:::

::::
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Last update: January 22, 2022 04:23
Contributors: Mr.Hope