macOS 下 sphinx + sphinx_rtd_theme 安装和使用

Spoony 70.4m2020-12-031254 次点击
#### Installing
```
brew install sphinx-doc
```
sphinx-doc is keg-only, which means it was not symlinked into /usr/local,
because this formula is mainly used internally by other formulae.
Users are advised to use pip to install sphinx-doc.

If you need to have sphinx-doc first in your PATH run:
```
echo 'export PATH="/usr/local/opt/sphinx-doc/bin:$PATH"' >> /Users/wangxianyuan/.bash_profile
```
----
#### Use sphinx_rtd_theme
Via Git or Download
https://github.com/readthedocs/sphinx_rtd_theme
Symlink or subtree the sphinx_rtd_theme/sphinx_rtd_theme repository into your documentation at docs/_themes/sphinx_rtd_theme then add the following two settings to your Sphinx conf.py file:
```
html_theme = "sphinx_rtd_theme"
html_theme_path = ["_themes", ]
```
----
#### Make
```
cd ~/docs
make html
```
收藏 ♥ 感谢
暂无回复

登录注册 后可回复。