* docs: add markdown-basic en * docs: add markdown-extensions en * docs: add markdown-icons en * docs: add markdown-mark en , change file structure * docs: update usage * docs: add to markdown-caniuse en * docs: add en docs markdown - import files * docs: add en docs markdown - collapse * chore: fix package lock file --------- Co-authored-by: pengzhanbo <volodymyr@foxmail.com>
5.2 KiB
title, icon, createTime, permalink, tags
| title | icon | createTime | permalink | tags | ||
|---|---|---|---|---|---|---|
| Installation/Usage | grommet-icons:install | 2025/03/02 13:28:45 | /en/guide/usage/ |
|
Dependency Environment
- Node.js v20.6.0+
- npm 8+ or pnpm 8+ or Yarn 2+
:::: details How to install the dependency environment? ::: steps
-
Please go to the Node.js Official Website to download the latest stable version
Follow the instructions to complete the installation. Generally, you only need to keep the default settings and choose Next during the installation process.
-
Install PNPM
After you have installed node.js, please open the terminal and run the following command:
corepack enableThe theme recommends using pnpm as the project manager.
-
Done
::: ::::
Command Line Installation
The theme provides a command line tool to help you build a basic project. You can run the following command to start the installation wizard.
::: npm-to
npm create vuepress-theme-plume@latest
:::
After starting the wizard, you only need to answer a few simple questions:
::: details How to use the command line tool?
Taking the Windows system as an example, you can use the following methods to start the CMD command line tool:
- Press the
Win + Rkeys to open the "Run" dialog. - Enter
cmdand press the Enter key. (You can also enterpowershellto open PowerShell)
Note that cmd may not be in the directory you expect. You can use the following command to switch to the correct directory:
D: # This command switches to the D: drive, enter other drives according to the actual situation
cd open-source # Enter the open-source directory under D:
Now, you can create a basic project by entering pnpm create vuepress-theme-plume@latest here.
The created project will be located in the D:\open-source\my-project directory.
:::
Manual Installation
::: info Note
- When using pnpm, you need to install
vueas a peer-dependency. - When using Yarn 2+, you need to set
nodeLinker: 'node-modules'in the.yarnrc.ymlfile. :::
To use this theme, you need to first create a new project and install vuepress@next and this theme.
:::: steps
-
Create a new folder and enter the directory
mkdir my-blog cd my-blog -
Initialize the project
::: npm-to
git init npm init:::
-
Install related dependencies
Install
vuepress@nextandvuepress-theme-plumeas local dependencies.::: npm-to
# Install vuepress npm i -D vuepress@next vue # Install theme and bundler npm i -D vuepress-theme-plume @vuepress/bundler-vite@next:::
:::warning The current version of the theme has been adapted to
vuepress@{{ vuepressVersion }}. You should install this version of VuePress. Versions higher or lower than this may have potential compatibility issues. ::: -
Add
scriptinpackage.json::: code-tabs @tab package.json
{ "scripts": { "docs:dev": "vuepress dev docs", "docs:build": "vuepress build docs" } }:::
vuepressdefaults to placing the documentation source code in thedocsdirectory. -
Add the default temporary and cache directories to the
.gitignorefile::: code-tabs @tab .gitignore
node_modules .temp .cache@tab sh
echo 'node_modules' >> .gitignore echo '.temp' >> .gitignore echo '.cache' >> .gitignore:::
-
Configure the theme in
docs/.vuepress/config.{js,ts}::: code-tabs @tab docs/.vuepress/config.ts
import { viteBundler } from '@vuepress/bundler-vite' import { defineUserConfig } from 'vuepress' import { plumeTheme } from 'vuepress-theme-plume' export default defineUserConfig({ // Don't forget to set the default language lang: 'zh-CN', theme: plumeTheme({ // more... }), bundler: viteBundler(), }):::
:::warning Whether or not you need to use multiple languages, you should configure the correct value for the
langoption in VuePress. The theme needs to determine the language environment text based on thelangoption. ::: -
Create a new
README.mdfile in thedocsdirectoryDeclare the home page configuration. ::: code-tabs @tab README.md
--- home: true ---:::
-
Start your documentation site on the local server
::: npm-to
npm run docs:dev:::
Vuepress will start a hot-reload development server at http://localhost:8080. When you modify your Markdown files, the content in the browser will also update automatically.
-
Done
::::
Update the Theme
You can run the following command directly in your project to check for available updates:
::: npm-to
npx vp-update
:::