首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用sphinx文档在合并中构建多个页面

如何使用sphinx文档在合并中构建多个页面
EN

Stack Overflow用户
提问于 2021-11-09 11:06:55
回答 1查看 82关注 0票数 1

我正在测试两个python脚本plants.py和interpolate.py。这两个脚本打印在同一页上。

如何将这两个脚本记录在两页合流中。

目前,这两个脚本文档都保存在名为"plants“的页面中。

index.rst文件:

代码语言:javascript
复制
.. spectRRa documentation master file, created by
   sphinx-quickstart on Fri Apr 24 11:55:57 2020.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.


Plants
******************************
.. toctree::
   :maxdepth: 2
   :caption: Contents:


plants
=================

.. automodule:: plants
         :members:

interpolate
******************
.. toctree::
      :maxdepth: 2
      :caption: Contents:

interpolate
=================

.. automodule:: interpolate
            :members:

conf.py:

代码语言:javascript
复制
# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.intersphinx',
    'sphinx.ext.ifconfig',
    'sphinx.ext.viewcode',
    'sphinx.ext.githubpages',
    'sphinxcontrib.confluencebuilder'
]

confluence_publish = True
confluence_space_name = 'DOCS'
confluence_server_url = '<>'
confluence_server_user = '<>'
confluence_server_pass = '<>'
#confluence_parent_page = 'Plants APIs'

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
    'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
    'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
    'preamble': '',
# Latex figure (float) alignment
    'figure_align': 'htbp',
}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-23 16:42:03

我明白了,如何在TOC页面的同时构建多个页面。

index.rst的结构应该在cd docs/sources目录下,其中assets、plant、Site、pipeline是python脚本的名称

代码语言:javascript
复制
.. spectRRa documentation master file, created by
   sphinx-quickstart on Fri Apr 24 11:55:57 2020.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

**API Docs**
***************
.. toctree::
   assets
   plants
   pipelines
   sites

还要在cd docs/ rst /目录中创建所有单独的rst文件。

Ex-对于assets.py脚本,assets.rst文件将位于下面。

代码语言:javascript
复制
.. spectRRa documentation master file, created by
 sphinx-quickstart on Fri Apr 24 11:55:57 2020.
 You can adapt this file completely to your liking, but it should at least
 contain the root `toctree` directive.

 .. toctree::
       :maxdepth: 2
       :caption: Contents:

**Assets**
=================

.. automodule:: assets
    :members:

注意-请不要更改缩进,否则将不起作用。

参考链接-Sphinx Documentation

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69897030

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档