Skip to content

Commit 08b7485

Browse files
authored
docs: support latest theme (#39)
1 parent f192231 commit 08b7485

10 files changed

+587
-600
lines changed

Diff for: docs/guide/bundler.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ VuePress supports using [Webpack](https://webpack.js.org/) or [Vite](https://vit
66

77
When installing the [vuepress](https://www.npmjs.com/package/vuepress) package, no bundlers will be installed. You need to choose a bundler to install.
88

9-
<CodeGroup>
10-
<CodeGroupItem title="pnpm" active>
9+
::: code-tabs#shell
10+
11+
@tab pnpm
1112

1213
```bash
1314
# install vite bundler
@@ -16,9 +17,7 @@ pnpm add -D vuepress@next @vuepress/bundler-vite@next
1617
pnpm add -D vuepress@next @vuepress/bundler-webpack@next
1718
```
1819

19-
</CodeGroupItem>
20-
21-
<CodeGroupItem title="yarn">
20+
@tab yarn
2221

2322
```bash
2423
# install vite bundler
@@ -27,9 +26,7 @@ yarn add -D vuepress@next @vuepress/bundler-vite@next
2726
yarn add -D vuepress@next @vuepress/bundler-webpack@next
2827
```
2928

30-
</CodeGroupItem>
31-
32-
<CodeGroupItem title="npm">
29+
@tab npm
3330

3431
```bash
3532
# install vite bundler
@@ -38,8 +35,7 @@ npm install -D vuepress@next @vuepress/bundler-vite@next
3835
npm install -D vuepress@next @vuepress/bundler-webpack@next
3936
```
4037

41-
</CodeGroupItem>
42-
</CodeGroup>
38+
:::
4339

4440
## Use a Bundler
4541

Diff for: docs/guide/getting-started.md

+30-50
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,27 @@ You can try VuePress directly in your browser on [StackBlitz](https://stackblitz
2828

2929
You can use [create-vuepress](https://www.npmjs.com/package/create-vuepress) to generate a template directly.
3030

31-
<CodeGroup>
32-
<CodeGroupItem title="pnpm" active>
31+
::: code-tabs#shell
32+
33+
@tab pnpm
3334

3435
```bash
3536
pnpm create vuepress vuepress-starter
3637
```
3738

38-
</CodeGroupItem>
39-
40-
<CodeGroupItem title="yarn">
39+
@tab yarn
4140

4241
```bash
4342
yarn create vuepress vuepress-starter
4443
```
4544

46-
</CodeGroupItem>
47-
48-
<CodeGroupItem title="npm">
45+
@tab npm
4946

5047
```bash
5148
npm init vuepress vuepress-starter
5249
```
5350

54-
</CodeGroupItem>
55-
</CodeGroup>
51+
:::
5652

5753
#### Setup Manually
5854

@@ -67,39 +63,36 @@ cd vuepress-starter
6763

6864
- Initialize your project
6965

70-
<CodeGroup>
71-
<CodeGroupItem title="pnpm" active>
66+
::: code-tabs#shell
67+
68+
@tab pnpm
7269

7370
```bash
7471
git init
7572
pnpm init
7673
```
7774

78-
</CodeGroupItem>
79-
80-
<CodeGroupItem title="yarn">
75+
@tab yarn
8176

8277
```bash
8378
git init
8479
yarn init
8580
```
8681

87-
</CodeGroupItem>
88-
89-
<CodeGroupItem title="npm">
82+
@tab npm
9083

9184
```bash
9285
git init
9386
npm init
9487
```
9588

96-
</CodeGroupItem>
97-
</CodeGroup>
89+
:::
9890

9991
- Install VuePress
10092

101-
<CodeGroup>
102-
<CodeGroupItem title="pnpm" active>
93+
::: code-tabs#shell
94+
95+
@tab pnpm
10396

10497
```bash
10598
# install vuepress and vue
@@ -108,9 +101,7 @@ pnpm add -D vuepress@next vue
108101
pnpm add -D @vuepress/bundler-vite@next @vuepress/theme-default@next
109102
```
110103

111-
</CodeGroupItem>
112-
113-
<CodeGroupItem title="yarn">
104+
@tab yarn
114105

115106
```bash
116107
# install vuepress
@@ -119,9 +110,7 @@ yarn add -D vuepress@next
119110
yarn add -D @vuepress/bundler-vite@next @vuepress/theme-default@next
120111
```
121112

122-
</CodeGroupItem>
123-
124-
<CodeGroupItem title="npm">
113+
@tab npm
125114

126115
```bash
127116
# install vuepress
@@ -130,8 +119,7 @@ npm install -D vuepress@next
130119
npm install -D @vuepress/bundler-vite@next @vuepress/theme-default@next
131120
```
132121

133-
</CodeGroupItem>
134-
</CodeGroup>
122+
:::
135123

136124
- Create `docs` directory and `docs/.vuepress` directory
137125

@@ -205,63 +193,55 @@ You can add some [scripts](https://classic.yarnpkg.com/en/docs/package-json#toc-
205193

206194
Then, run `docs:dev` script to start the dev server:
207195

208-
<CodeGroup>
209-
<CodeGroupItem title="pnpm" active>
196+
::: code-tabs#shell
197+
198+
@tab pnpm
210199

211200
```bash
212201
pnpm docs:dev
213202
```
214203

215-
</CodeGroupItem>
216-
217-
<CodeGroupItem title="yarn">
204+
@tab yarn
218205

219206
```bash
220207
yarn docs:dev
221208
```
222209

223-
</CodeGroupItem>
224-
225-
<CodeGroupItem title="npm">
210+
@tab npm
226211

227212
```bash
228213
npm run docs:dev
229214
```
230215

231-
</CodeGroupItem>
232-
</CodeGroup>
216+
:::
233217

234218
VuePress will start a hot-reloading development server at [http://localhost:8080](http://localhost:8080). When you modify your markdown files, the content in the browser will be auto updated.
235219

236220
### Build Your Site
237221

238222
To build your site, run `docs:build` script:
239223

240-
<CodeGroup>
241-
<CodeGroupItem title="pnpm" active>
224+
::: code-tabs#shell
225+
226+
@tab pnpm
242227

243228
```bash
244229
pnpm docs:build
245230
```
246231

247-
</CodeGroupItem>
248-
249-
<CodeGroupItem title="yarn">
232+
@tab yarn
250233

251234
```bash
252235
yarn docs:build
253236
```
254237

255-
</CodeGroupItem>
256-
257-
<CodeGroupItem title="npm">
238+
@tab npm
258239

259240
```bash
260241
npm run docs:build
261242
```
262243

263-
</CodeGroupItem>
264-
</CodeGroup>
244+
:::
265245

266246
You will see the generated static files in the `docs/.vuepress/dist` directory. You can check out [deployment](./deployment.md) for how to deploy them.
267247

Diff for: docs/guide/markdown.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -501,5 +501,8 @@ If you want to use those tags anyway, try either of the following workarounds:
501501

502502
- Adding a [v-pre](https://vuejs.org/api/built-in-directives.html#v-pre) directive to skip the compilation of the element and its children. Notice that the template syntax would also be invalid.
503503
- Using [compilerOptions.isCustomElement](https://vuejs.org/api/application.html#app-config-compileroptions) to tell Vue template compiler not try to resolve them as components.
504-
- For `@bundler-webpack`, set [vue.compilerOptions](../reference/bundler/webpack.md#vue)
505-
- For `@bundler-vite`, set [vuePluginOptions.template.compilerOptions](../reference/bundler/vite.md#vuepluginoptions)
504+
- For `@vuepress/bundler-webpack`, set [vue.compilerOptions](../reference/bundler/webpack.md#vue)
505+
- For `@vuepress/bundler-vite`, set [vuePluginOptions.template.compilerOptions](../reference/bundler/vite.md#vuepluginoptions)
506+
507+
[prismjs]: https://ecosystem.vuejs.press/plugins/markdown/prismjs.html
508+
[shiki]: https://ecosystem.vuejs.press/plugins/markdown/shiki.html

Diff for: docs/guide/migration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ Removed.
314314

315315
#### Built-in Components
316316

317-
- `<CodeGroup />` and `<CodeBlock />` renamed to `<CodeGroup />` and `<CodeGroupItem />`
317+
- `<CodeGroup />` and `<CodeBlock />` are replaced by [code tab feature](https://ecosystem.vuejs.press/themes/default/markdown.html#code-tabs)
318318
- `<Badge />`
319319
- `$badgeErrorColor` palette variable renamed to `$badgeDangerColor`
320320
- `type` prop only accepts `tip`, `warning` and `danger` now

Diff for: docs/zh/guide/bundler.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ VuePress 支持使用 [Vite](https://vitejs.dev/) 或 [Webpack](https://webpack.
66

77
在安装 [vuepress](https://www.npmjs.com/package/vuepress) 包时,并不会自动安装打包工具,你需要选择并安装一个打包工具。
88

9-
<CodeGroup>
10-
<CodeGroupItem title="pnpm" active>
9+
::: code-tabs#shell
10+
11+
@tab pnpm
1112

1213
```bash
1314
# 安装 vite 打包工具
@@ -16,9 +17,7 @@ pnpm add -D vuepress@next @vuepress/bundler-vite@next
1617
pnpm add -D vuepress@next @vuepress/bundler-webpack@next
1718
```
1819

19-
</CodeGroupItem>
20-
21-
<CodeGroupItem title="yarn">
20+
@tab yarn
2221

2322
```bash
2423
# 安装 vite 打包工具
@@ -27,9 +26,7 @@ yarn add -D vuepress@next @vuepress/bundler-vite@next
2726
yarn add -D vuepress@next @vuepress/bundler-webpack@next
2827
```
2928

30-
</CodeGroupItem>
31-
32-
<CodeGroupItem title="npm">
29+
@tab npm
3330

3431
```bash
3532
# 安装 vite 打包工具
@@ -38,8 +35,7 @@ npm install -D vuepress@next @vuepress/bundler-vite@next
3835
npm install -D vuepress@next @vuepress/bundler-webpack@next
3936
```
4037

41-
</CodeGroupItem>
42-
</CodeGroup>
38+
:::
4339

4440
## 使用打包工具
4541

0 commit comments

Comments
 (0)