Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - How NOT to sort Sphinx output in alphabetical order

With Sphinx for Python how is it possible to avoid having all the method/function names sorted alphabetically in HTML? I want to keep them in the very same order as they are found in the source code.

like image 978
Alex Poca Avatar asked May 13 '16 12:05

Alex Poca


1 Answers

From the 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.

So somewhere in your conf.py file, put:

autodoc_member_order = 'bysource' 
like image 142
James Scholes Avatar answered Sep 19 '22 17:09

James Scholes