自定义模块名称不显示与自动分类

问题描述

我正在使用 { "sap.ui": { "fullWidth": true } } 构建文档,并且我的 .rst 文件之一具有以下内容

sphinx

构建成功,但请查看附加的屏幕截图:

pic

问题在于 ############ Internal API ############ .. autoclass:: Individual::Individual :noindex: :special-members: :exclude-members: __weakref__ :member-order: bysource :members: .. autoclass:: exceptions::Error :noindex: :special-members: :exclude-members: __weakref__ :member-order: bysource :members: .. autoclass:: exceptions::IncorrectValueError :noindex: :special-members: :exclude-members: __weakref__ :member-order: bysource :members: 类正确地以 Individual 模块名称作为前缀,而位于 exceptions.py 中的后两个类则没有。为什么会发生这种情况,我该如何解决

编辑:我在下面添加Individual内容(没有不必要的部分):

conf.py

以及import os import sys import sphinx_rtd_theme sys.path.insert(0,os.path.abspath('../moranpycess')) extensions = [ 'sphinx.ext.napoleon','sphinx_rtd_theme','recommonmark',] templates_path = ['_templates'] exclude_patterns = ['_build','Thumbs.db','.DS_Store'] html_theme = 'sphinx_rtd_theme' html_show_sourcelink = False html_static_path = ['_static'] 内容

exceptions.py

解决方法

这确实是 sphinx 中保留名称的特例:
https://github.com/sphinx-doc/sphinx/issues/9280

它将在新版本中修复。