Skip to content

Commit bd04fb7

Browse files
feat: add member_order to autoapi (#495)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 2ce4350 commit bd04fb7

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

doc/changelog.d/495.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
feat: add member_order to autoapi

doc/source/user-guide/autoapi.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ and set the ``ansys_sphinx_theme_autoapi`` theme options in the ``html_theme_opt
2929
By default, this is set to ``False``.
3030
- ``package_depth``: The depth of the package. By default, this is set to ``3``. This is the ``namespace`` depth of the package.
3131
For example, if the package is ``ansys``, the depth is ``1``. If the package is ``ansys.foo``, the depth is ``2``.
32+
- ``member_order``: The order to document members. By default, this is set to ``bysource``. Other options include
33+
``alphabetical``, which orders members by their name (case sensitive), or ``groupwise``, which orders members by their type
34+
and alphabetically.
3235

3336
All these options can be set in the ``conf.py`` file of your Sphinx project.
3437

@@ -54,6 +57,7 @@ All these options can be set in the ``conf.py`` file of your Sphinx project.
5457
"ignore": [],
5558
"add_toctree_entry": False,
5659
"package_depth": 3,
60+
"member_order": "bysource",
5761
}
5862
}
5963

src/ansys_sphinx_theme/extension/autoapi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def prepare_jinja_env(jinja_env) -> None:
7676
app.config["autoapi_options"] = autoapi.get("options", AUTOAPI_OPTIONS)
7777
app.config["autoapi_ignore"] = autoapi.get("ignore", [])
7878
app.config["autoapi_add_toctree_entry"] = autoapi.get("add_toctree_entry", True)
79+
app.config["autoapi_member_order"] = autoapi.get("member_order", "bysource")
7980

8081
# HACK: The ``autoapi_dirs`` should be given as a relative path to the conf.py.
8182
relative_autoapi_dir = os.path.relpath(

0 commit comments

Comments
 (0)