From 40da45d038bbeb8d7bdb229e196b6a47fd180796 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:43:29 +0530 Subject: [PATCH] chore: move init terminal output to separate file --- docs/guide/getting-started.md | 19 +------------------ docs/snippets/init.ansi | 16 ++++++++++++++++ src/node/init/init.ts | 2 +- src/node/markdown/plugins/preWrapper.ts | 1 + 4 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 docs/snippets/init.ansi diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 43e049cf..9e05b673 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -71,24 +71,7 @@ $ pnpm dlx vitepress init You will be greeted with a few simple questions: -```ansi -┌  Welcome to VitePress! -│ -◇ Where should VitePress initialize the config? -│ ./docs -│ -◇ Site title: -│ My Awesome Project -│ -◇ Site description: -│ A VitePress Site -│ -◆ Theme: -│ ● Default Theme (Out of the box, good-looking docs) -│ ○ Default Theme + Customization -│ ○ Custom Theme -└ -``` +<<< @/snippets/init.ansi ::: tip Vue as Peer Dependency If you intend to perform customization that uses Vue components or APIs, you should also explicitly install `vue` as a peer dependency. diff --git a/docs/snippets/init.ansi b/docs/snippets/init.ansi new file mode 100644 index 00000000..287149f9 --- /dev/null +++ b/docs/snippets/init.ansi @@ -0,0 +1,16 @@ +┌ Welcome to VitePress! +│ +◇ Where should VitePress initialize the config? +│ ./docs +│ +◇ Site title: +│ My Awesome Project +│ +◇ Site description: +│ A VitePress Site +│ +◆ Theme: +│ ● Default Theme (Out of the box, good-looking docs) +│ ○ Default Theme + Customization +│ ○ Custom Theme +└ \ No newline at end of file diff --git a/src/node/init/init.ts b/src/node/init/init.ts index 4e7ebe24..6273a37a 100644 --- a/src/node/init/init.ts +++ b/src/node/init/init.ts @@ -37,7 +37,7 @@ const getPackageManger = () => { } export async function init() { - intro(bold(cyan(' Welcome to VitePress! '))) + intro(bold(cyan('Welcome to VitePress!'))) const options: ScaffoldOptions = await group( { diff --git a/src/node/markdown/plugins/preWrapper.ts b/src/node/markdown/plugins/preWrapper.ts index db237dbf..c7eca196 100644 --- a/src/node/markdown/plugins/preWrapper.ts +++ b/src/node/markdown/plugins/preWrapper.ts @@ -43,4 +43,5 @@ function extractLang(info: string) { .replace(/:(no-)?line-numbers({| |$).*/, '') .replace(/(-vue|{| ).*$/, '') .replace(/^vue-html$/, 'template') + .replace(/^ansi$/, '') }