Skip to content

Commit

Permalink
feat: update readme to use mdbook
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsms committed Oct 25, 2023
1 parent 7333efa commit ba967b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ mdbook/
book/
dist
.DS_Store
.idea
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,29 @@ PS:

## 静态页面构建与文档撰写

![image](./vuepress_page.png)

### 构建

你可以将本 mdbook 构建成一系列静态 html 页面。这里我们采用 [vuepress](https://vuepress.vuejs.org/zh/) 打包出静态网页。在这之前,你需要安装 [Nodejs](https://nodejs.org/zh-cn/)
你可以将本 mdbook 构建成一系列静态 html 页面。这里我们采用 [mdbook](https://rust-lang.github.io/mdBook/index.html) 打包出静态网页。在这之前,你需要安装 [Rust](https://www.rust-lang.org/zh-CN/)

全局安装 vuepress
全局安装 mdbook

``` bash
npm i -g vuepress
cargo install mdbook
```

cd 到项目目录,然后开始构建。构建好的静态文档会出现在 "./src/.vuepress/dist" 中
cd 到项目目录,然后开始构建。构建好的静态文档会出现在 "./book/html" 中

```bash
vuepress build ./src
mdbook build
```

### 文档撰写

vuepress 会启动一个本地服务器,并在浏览器对你保存的文档进行实时热更新。
可以通过任意的 http 服务器来预览构建的文档。举个例子:

```bash
vuepress dev ./src
cargo install simple-http-server
simple-http-server .\book\html\ -i
```

## 社区资源
Expand Down
9 changes: 0 additions & 9 deletions src/.vuepress/config.js

This file was deleted.

0 comments on commit ba967b8

Please sign in to comment.