Commit 955918bce32cb6e6c4347ad5021c5dd14ef22b33

Authored by zichun
1 parent 568e3c49

README: document venv + dependency install step

The build/serve commands all start with `.venv/bin/mkdocs ...` but the
README never said how the .venv is created or how to install
dependencies. Added an Install section to both the Chinese and English
halves of the README, with the standard `python3 -m venv .venv` +
`pip install -r en/requirements.txt` flow. Note that .venv/ is
gitignored and should never be committed.
Showing 1 changed file with 26 additions and 0 deletions
README.md
@@ -11,6 +11,19 @@ xly-wiki/ @@ -11,6 +11,19 @@ xly-wiki/
11 └── site/ 共享生成输出,已被 git 忽略 11 └── site/ 共享生成输出,已被 git 忽略
12 ``` 12 ```
13 13
  14 +## 安装
  15 +
  16 +依赖只需安装一次,全部装在仓库根目录的 `.venv/` 中(已被 git 忽略,请勿提交):
  17 +
  18 +```bash
  19 +python3 -m venv .venv
  20 +.venv/bin/pip install -r en/requirements.txt
  21 +```
  22 +
  23 +`zh/requirements.txt` 与英文版相同;上面那条命令已经覆盖两种语言。
  24 +
  25 +如果之后修改了 `requirements.txt`(例如新增依赖),重新执行同一条 `pip install` 即可更新。
  26 +
14 ## 构建 27 ## 构建
15 28
16 ```bash 29 ```bash
@@ -61,6 +74,19 @@ xly-wiki/ @@ -61,6 +74,19 @@ xly-wiki/
61 └── site/ shared generated output, ignored by git 74 └── site/ shared generated output, ignored by git
62 ``` 75 ```
63 76
  77 +## Install
  78 +
  79 +Dependencies are installed once into a `.venv/` at the repo root (gitignored — do not commit it):
  80 +
  81 +```bash
  82 +python3 -m venv .venv
  83 +.venv/bin/pip install -r en/requirements.txt
  84 +```
  85 +
  86 +`zh/requirements.txt` is identical to the English file, so the single command above covers both languages.
  87 +
  88 +If `requirements.txt` changes later (new dependency added), re-run the same `pip install` to refresh.
  89 +
64 ## Build 90 ## Build
65 91
66 ```bash 92 ```bash