read-the-docs托管學習筆記_html/css
來源:懂視網
責編:小采
時間:2020-11-27 16:39:53
read-the-docs托管學習筆記_html/css
read-the-docs托管學習筆記_html/css_WEB-ITnose:Sphinx 是一個基于Python的文檔生成項目,采用了 reStructuredText 作為文檔寫作語言 ,不過也可以通過模塊支持其他格式. (Sphinx標記結構)[ http://www.pythondoc.com/sphinx/markup/ ] Sphinx安裝 pip install s
導讀read-the-docs托管學習筆記_html/css_WEB-ITnose:Sphinx 是一個基于Python的文檔生成項目,采用了 reStructuredText 作為文檔寫作語言 ,不過也可以通過模塊支持其他格式. (Sphinx標記結構)[ http://www.pythondoc.com/sphinx/markup/ ] Sphinx安裝 pip install s

Sphinx 是一個基于Python的文檔生成項目,采用了 reStructuredText 作為文檔寫作語言 ,不過也可以通過模塊支持其他格式.
(Sphinx標記結構)[ http://www.pythondoc.com/sphinx/markup/ ]
Sphinx安裝
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 后效果如下:
支持markdown編寫
更改conf.py:
from recommonmark.parser import CommonMarkParsersource_parsers = { '.md': CommonMarkParser,}source_suffix = ['.rst', '.md']
更改主題 sphinx_rtd_theme
pip install sphinx_rtd_theme
更改conf.py:
import sphinx_rtd_themehtml_theme = "sphinx_rtd_theme"html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
Github托管, read_the_docs發布
doc
- github上 push 用 sphinx-quickstart 生成的項目, build 目錄可以設置到.gitignore中
- 登錄 readthedocs ,注冊賬號, Connected Services 中授權 github
- dashboard 中 Import a Porject 導入 github 中的項目然后 build
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
read-the-docs托管學習筆記_html/css
read-the-docs托管學習筆記_html/css_WEB-ITnose:Sphinx 是一個基于Python的文檔生成項目,采用了 reStructuredText 作為文檔寫作語言 ,不過也可以通過模塊支持其他格式. (Sphinx標記結構)[ http://www.pythondoc.com/sphinx/markup/ ] Sphinx安裝 pip install s