Skip to content

Docs Dev Guide

Directory Structure

/
  • .eslintignore
  • .eslintrc.cjs
  • .prettierignore
  • .prettierrc
  • README.md
  • content
    • .vitepress
      • components
        • LocalSearchBox.vue
        • NavBar.vue
        • NavBarMenuLink.vue
        • NavBarTranslations.vue
      • composables
        • index.ts
      • config.ts
      • configs
        • index.ts
        • locales
          • en.ts
          • index.ts
          • zh-CN.ts
        • search
          • index.ts
          • stopwords.ts
          • translate.ts
      • mathjax.ts
      • shim.d.ts
    • api-examples.md
    • developer-guide
      • dev-docs.md
    • index.md
    • markdown-examples.md
    • public
      • image.jpg
      • logo.svg
    • tsconfig.json
    • zh-CN
      • api-examples.md
      • developer-guide
        • deploy
          • k8s-deploy.md
          • local-deploy.md
        • dev-backend.md
        • dev-docs.md
        • dev-frontend.md
        • structure-and-guidelines.md
      • index.md
      • markdown-examples.md
      • overview
        • installation.md
        • quick-start.md
        • system-overview.md
      • user-guide
        • learnware-deploy.md
        • learnware-search.md
        • learnware-upload
          • prepare.md
          • upload.md
  • package.json
  • pnpm-lock.yaml

Environment Setup

  1. Install nvm
bash
# use curl:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
# or use wget:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
# use curl:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
# or use wget:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
  1. Install node
bash
nvm install node
nvm install node
  1. Install pnpm
bash
npm install -g pnpm
npm install -g pnpm
  1. Install Dependencies: Make sure you are in the project's root directory Beiming-System/docs/.
bash
pnpm install
pnpm install

Development

Run Development Server

Run the following command to start the development server.

bash
pnpm dev
pnpm dev

If everything goes well, you will see the following output:

bash
> vitepress dev docs

  vitepress v1.0.0-rc.21

    Local:   http://localhost:5173/
    Network: use --host to expose
    press h to show help
> vitepress dev docs

  vitepress v1.0.0-rc.21

    Local:   http://localhost:5173/
    Network: use --host to expose
    press h to show help

Afterward, make changes to markdown files under the content directory, and the browser will automatically reload to display the changes.

Adding Static Files

If you want to add static files like images, you can place them in the Beiming-System/docs/content/public/ directory. Then, you can access them in markdown files like this:

markdown
![image](/image.png)
![image](/image.png)

Setting Up Navigation and Sidebar

You should set up this according to the language. For example, if you want to set up navigation and sidebar for the en language, you should edit the Beiming-System/docs/content/.vitepress/config/locales/en.ts file.

Other Configuration

You can find more configuration options in the VitePress documentation.

Deployment

Run the following command to build static files.

bash
pnpm build
pnpm build

Static files will be generated in the Beiming-System/docs/content/.vitepress/dist/ directory. You can deploy them to any static file server.