Skip to content

Commit

Permalink
docs: use code group for commands in "Getting Started" (#1904)
Browse files Browse the repository at this point in the history
  • Loading branch information
manchan4869 authored Feb 8, 2023
1 parent 48c9b11 commit b35a627
Showing 1 changed file with 39 additions and 4 deletions.
43 changes: 39 additions & 4 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,42 @@ $ mkdir vitepress-starter && cd vitepress-starter

Then, initialize with your preferred package manager.

```sh
::: code-group

```sh [npm]
$ npm init
```

```sh [yarn]
$ yarn init
```

```sh [pnpm]
$ pnpm init
```

:::

## Step 2: Install VitePress

Add VitePress and Vue as dev dependencies for the project.

```sh
$ yarn add --dev vitepress vue
::: code-group

```sh [npm]
$ npm install -D vitepress vue
```

```sh [yarn]
$ yarn add -D vitepress vue
```

```sh [pnpm]
$ pnpm add -D vitepress vue
```

:::

::: details Getting missing peer deps warnings?
`@docsearch/js` has certain issues with its peer dependencies. If you see some commands failing due to them, you can try this workaround for now:

Expand Down Expand Up @@ -71,10 +95,21 @@ Add some scripts to `package.json`.

Serve the documentation site in the local server.

```sh
::: code-group

```sh [npm]
$ npm run docs:dev
```

```sh [yarn]
$ yarn docs:dev
```

```sh [pnpm]
$ pnpm run docs:dev
```

:::
VitePress will start a hot-reloading development server at `http://localhost:5173`.

## Step 4: Add more pages
Expand Down

0 comments on commit b35a627

Please sign in to comment.