Python - 如何不按字母顺序对 Sphinx 输出进行排序
Python - How NOT to sort Sphinx output in alphabetical order
使用 Python 的 Sphinx 如何避免 method/function 中的所有名称在 HTML 中按字母顺序排序?
我想让它们的顺序与它们在源代码中的顺序完全相同。
来自sphinx.ext.autodoc documentation:
autodoc_member_order
This value selects if automatically documented members are sorted alphabetical (value 'alphabetical'), by member type (value 'groupwise') or by source order (value 'bysource'). The default is alphabetical.
Note that for source order, the module must be a Python module with the source code available.
所以在你的 conf.py 文件的某处,输入:
autodoc_member_order = 'bysource'
对于单个 .rst
文件(查看最后一个字符串):
foo.bar module
=========================
.. automodule:: foo.bar
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource
使用 Python 的 Sphinx 如何避免 method/function 中的所有名称在 HTML 中按字母顺序排序? 我想让它们的顺序与它们在源代码中的顺序完全相同。
来自sphinx.ext.autodoc documentation:
autodoc_member_order
This value selects if automatically documented members are sorted alphabetical (value 'alphabetical'), by member type (value 'groupwise') or by source order (value 'bysource'). The default is alphabetical.
Note that for source order, the module must be a Python module with the source code available.
所以在你的 conf.py 文件的某处,输入:
autodoc_member_order = 'bysource'
对于单个 .rst
文件(查看最后一个字符串):
foo.bar module
=========================
.. automodule:: foo.bar
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource