美文网首页
Sphinx -- 文档

Sphinx -- 文档

作者: saoraozhe3hao | 来源:发表于2023-05-28 18:15 被阅读0次

环境搭建

1、安装 python 环境
2、pip install sphinx sphinx-autobuild recommonmark sphinx-markdown-tables sphinx_rtd_theme

项目搭建

1、新建工作目录 mkdir sphinx
2、在工作目录中 sphinx-quickstart
3、编辑配置文件 source/conf.py

extensions = ['recommonmark', 'sphinx_markdown_tables']
html_theme = 'sphinx_rtd_theme'
html_title = '用户手册'
html_logo = 'logo.png'
html_favicon = 'favicon.ico'  
html_css_files = ['custom.css']   # 自定义样式,放在 html_static_path 下

4、编辑入口导航文件 source/index.rst,支持引用 .md 文件

.. toctree::
   :maxdepth: 2
   :caption: 用户手册

   01.md
   02/help.md

Indices and Tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

5、构建 make html

支持中文搜索

1、pip install jieba
2、编辑source/conf.py

html_search_language = 'zh'

相关文章

网友评论

      本文标题:Sphinx -- 文档

      本文链接:https://www.haomeiwen.com/subject/yludedtx.html