美文网首页
【工具使用】sphinx安装&使用说明

【工具使用】sphinx安装&使用说明

作者: 昭君姐 | 来源:发表于2019-07-07 21:10 被阅读0次
  • 安装sphinx
    pip3 install sphinx sphinx-autobuild sphinx_rtd_theme recommonmark sphinx-markdown-tables –user
  • 新建项目文件夹
    mkdir my_project_name
  • 快速启动
    sphinx-quickstart
    主要填下面信息,其他默认按回车键就行

Project name:
Author name(s):

  • 编辑文档
    source/_static目录放一些静态文件,如image等。source/index.rst文档中定义目录结构。source/conf.py为配置文件。推荐主题html_theme = ‘sphinx_rtd_theme’。此外默认不支持markdown,修改extensions和source_suffix如下:
extensions = [
    'sphinx_markdown_tables',
    'sphinxcontrib.mermaid',
]
from recommonmark.parser import CommonMarkParser
source_parsers = {
'.md': CommonMarkParser,
}
source_suffix = ['.rst', '.md']
  • 编译发布:项目主目录里执行make html

相关文章

网友评论

      本文标题:【工具使用】sphinx安装&使用说明

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