我使用sphinx作为文档。当我使用"make confluence"时,我从索引中得到了以下警告。rst文件。
如何删除这些警告?此外,由于这些警告,目录不能在合流中工作,但文档正在代码中创建。
任何建议/帮助都将是非常感激的。
[4px@learning-2 docs]$ make confluence
Running Sphinx v4.2.0
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [confluence]: targets for 0 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
/usr/lib64/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
return f(*args, **kwds)
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
/home/4px/sphinx/docs/source/index.rst:: WARNING: unable to build link to document due to missing title (in index): genindex
/home/4px/sphinx/docs/source/index.rst:: WARNING: unable to build link to document due to missing title (in index): py-modindex
/home/4px/sphinx/docs/source/index.rst:: WARNING: unable to build link to document due to missing title (in index): search
publishing documents... [100%] index
Publish point: https://<........>.atlassian.net/wiki/spaces/DOCS/pages/4194009282
building intersphinx... done
build succeeded, 3 warnings.
索引。rst文件——
.. 4px documentation master file, created by
sphinx-quickstart on Tue Oct 26 11:19:49 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
API Documentation
**************************
CODE DOCUMENTATION
====================================
.. toctree::
:hidden:
index
featureSelection
==================
.. automodule:: featureSelection
:members:
interpolate
============
.. automodule:: interpolate
:members:
pets
============
.. automodule:: pets
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
我有一个github问题关于这个警告,但它是旧版本。
Sphinx 2.2.2 warning·Issue #265·Sphinx -contrib/confluencebuilder
在清理索引后,下面的警告将被删除。并为每个python脚本创建单独的RST文件,而不是在索引中添加结构化格式。
它产生了在合流中创建TOC页面的另一个优点。
索引结构。rst应该在cd docs/sources目录下,其中assets, plant,Site, pipeline是python脚本的名称
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.
**API Docs**
***************
.. toctree::
assets
plants
pipelines
sites
同时在cd docs/sources/目录下创建所有单独的rst文件
ex -对于assets.py脚本,资产。RST文件将在下面。
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:
注意-请不要改变缩进,否则它将不起作用,并抛出缩进警告。
Ref Link-Stack overflow TOC page generation using sphinx confluence builder
Sphinx文档
我不确定这是否会有所帮助,但是您的reStructuredText具有随机缩进和不匹配的标题下划线长度。在reStructuredText中留白很重要。试着清理一下,像这样:
API Documentation
*****************
CODE DOCUMENTATION
==================
.. toctree::
:hidden:
index
featureSelection
================
.. automodule:: featureSelection
:members:
interpolate
===========
.. automodule:: interpolate
:members:
pets
====
.. automodule:: pets
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
您正在构建的合流页面不支持这些功能。如果您尝试make html
,您会注意到没有这些警告,因为sphinx为您创建了搜索页面和索引页面。Confluence已经内置了这些功能。(在confluence中创建"索引页"有点奇怪。)无论哪种方式,:ref:
线在构建合流时都是不必要的。如果你同时构建confluence和html,那就忽略这个警告。如果你仍然真的想要索引页面合并(不确定如何复制搜索),你可以尝试手动构建页面,而不需要:ref:
行。