(Sphinx标记结构)[ http://www.pythondoc.com/sphinx/markup/ ]
pip install sphinx sphinx-autobuild
#创建目录cd /path/to/projectmkdir docs#sphinx工作目录基本配置cd docs#可以回车按默认配置来写sphinx-quickstart#quickstart 后生成的目录结构readthedocs│ make.bat│ Makefile├─build└─source │ conf.py │ index.rst ├─_static └─_templates# 默认会有一个index.rst,make html用来生成html页面make html
在 source 目录下新建 hello.rst :
hello,world======================================
index.rst修改如下:
Contents:.. toctree:: :maxdepth: 2 hello
make html 后效果如下:
pip install recommonmark
from recommonmark.parser import CommonMarkParsersource_parsers = { '.md': CommonMarkParser,}source_suffix = ['.rst', '.md']
pip install sphinx_rtd_theme
import sphinx_rtd_themehtml_theme = "sphinx_rtd_theme"html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
doc
Copyright © 2019- ovod.cn 版权所有 湘ICP备2023023988号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务