如何使用Shinx文档同时构建多个页面
问题描述
我正在测试两个Python脚本ants s.py和interpolate.py。 两个脚本打印在同一页上。
如何在合流的两页中记录这两个脚本。
目前,两个脚本文档都保存在名为";Plants";的页面中。
index.rst文件:
.. 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:
# -- 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 = []
解决方案
我明白了,如何在合流中构建多个页面以及目录页。
index.rst的结构应在cd docs/Sources目录下,其中Assets、PLANT、SITE、PIPELINE是Python脚本的名称
数据-lang="js"数据-隐藏="假"数据-控制台="真"数据-巴贝尔="假">.. 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/Sources/目录中创建所有单独的rst文件。
Ex-对于assets.py脚本,assets.rst文件将位于下面。
数据-lang="js"数据-隐藏="假"数据-控制台="真"数据-巴贝尔="假">.. 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
相关文章