在 Windows 上安装¶
本指南包含以下主题:
安装 Python(用于将源文件 “转换” 为 HTML)
安装 Python¶
下载适用于 Windows 的 Python 安装包,本指南使用版本为 3.9.x 。
使用安装向导安装 Python 。记得勾选 "Add Python to PATH" 选项:
该选项必须勾选,这样才能使用脚本编译手册。¶
其余所有设置维持默认。
安装 Git 并下载代码库¶
在本指南中,我们将使用官方 Git 客户端,当然任何 Git 客户端都可以。
下载并安装 Windows 版的 Git。
使用下面的命令检出 Blender 手册代码库:
cd ~ git lfs install git clone https://projects.blender.org/blender/blender-manual.git
代码库下载需要几分钟时间,这取决于你的网络连接。
Note
该过程可通过图形化 Git 客户端完成,在这种情况下,只需在客户端提供的 URL 字段中使用版本库地址即可:
https://projects.blender.org/blender/blender-manual.git
设置编译环境¶
打开终端窗口。
进入刚被
git clone
添加的blender-manual
文件夹:cd C:\blender-manual
Install dependencies:
make setup
如果一切顺利,完成后会显示以下信息:
Successfully installed Jinja2 MarkupSafe Pygments Sphinx docutils sphinx-rtd-theme Cleaning up...
During setup, some warnings may be shown, but do not worry about them. However, if any errors occur, they may cause some problems.
Note
Every now and then you need to re-run this command, to make sure dependencies are up to date.
Tip
make setup
automatically creates a virtual environment using these commands:
python -m venv .venv
.venv/Scripts/pip install -r requirements.txt
This avoids interfering with the system Python installation, following PEP 668
The Sphinx command is available at:
.venv/Scripts/sphinx-build