Read the docs 撰写文档¶
Use sphinx to write a documentation, and host it on RTD, just like this page(site) you are reading.
使用 sphinx 初始化¶
通过 pip 安装 sphinx 然后使用 sphinx-quickstart
初始化。
$ pip install sphinx
$ cd /path/to/project
$ mkdir docs
$ cd docs
$ sphinx-quickstart
编辑 .rst
文件撰写内容。
在本地生成 html 预览,运行:
$ make html
Localization of Documentation¶
Create/Update translatable files:
$ make gettext
or:
$ sphinx-build -b gettext . _build/gettext
This command above will leave the generated files under _build/gettext
.
Generate .po
files from source language manually:
$ sphinx-intl update -p _build/gettext -l zh_CN
Do translate, edit the .po
files.
Then,
Build the documentation in target language, for preview locally:
$ sphinx-build -D language=zh_CN . _build/html/zh_CN
Multi-languages in RTD¶
Manually.