From ab6742eec1aaa7ba3a885d0734e7f77e4a526e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=90=E6=BB=A1?= <2445937718@qq.com> Date: Wed, 8 Feb 2023 11:07:17 +0800 Subject: [PATCH] update getting-started --- docs/guide/getting-started.md | 43 +++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 3b4397d4..3261a704 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -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: @@ -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 docs:dev +``` + +::: VitePress will start a hot-reloading development server at `http://localhost:5173`. ## Step 4: Add more pages