如何使用 sphinx 文档在 confluence 中构建多个页面
How to build multiple pages in confluence using sphinx documentation
我正在测试两个 python 脚本 plants.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 = []
我知道了,如何与 TOC 页面一起构建多个页面。
index.rst的结构应该在cd docs/sources目录下面,其中assets,plant,Site,pipeline是python脚本的名字
.. 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/ 目录中创建所有单独的第一个文件。
Ex-对于 assets.py 脚本,assets.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.
.. toctree::
:maxdepth: 2
:caption: Contents:
**Assets**
=================
.. automodule:: assets
:members:
注意-请不要更改缩进,否则将不起作用。
参考 Link-Sphinx Documentation
我正在测试两个 python 脚本 plants.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 = []
我知道了,如何与 TOC 页面一起构建多个页面。
index.rst的结构应该在cd docs/sources目录下面,其中assets,plant,Site,pipeline是python脚本的名字
.. 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/ 目录中创建所有单独的第一个文件。
Ex-对于 assets.py 脚本,assets.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.
.. toctree::
:maxdepth: 2
:caption: Contents:
**Assets**
=================
.. automodule:: assets
:members:
注意-请不要更改缩进,否则将不起作用。
参考 Link-Sphinx Documentation