Skip to content

Commit

Permalink
feat: add member_order to autoapi (#495)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
klmcadams and pyansys-ci-bot authored Sep 10, 2024
1 parent 2ce4350 commit bd04fb7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/495.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: add member_order to autoapi
4 changes: 4 additions & 0 deletions doc/source/user-guide/autoapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ and set the ``ansys_sphinx_theme_autoapi`` theme options in the ``html_theme_opt
By default, this is set to ``False``.
- ``package_depth``: The depth of the package. By default, this is set to ``3``. This is the ``namespace`` depth of the package.
For example, if the package is ``ansys``, the depth is ``1``. If the package is ``ansys.foo``, the depth is ``2``.
- ``member_order``: The order to document members. By default, this is set to ``bysource``. Other options include
``alphabetical``, which orders members by their name (case sensitive), or ``groupwise``, which orders members by their type
and alphabetically.

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

Expand All @@ -54,6 +57,7 @@ All these options can be set in the ``conf.py`` file of your Sphinx project.
"ignore": [],
"add_toctree_entry": False,
"package_depth": 3,
"member_order": "bysource",
}
}
Expand Down
1 change: 1 addition & 0 deletions src/ansys_sphinx_theme/extension/autoapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def prepare_jinja_env(jinja_env) -> None:
app.config["autoapi_options"] = autoapi.get("options", AUTOAPI_OPTIONS)
app.config["autoapi_ignore"] = autoapi.get("ignore", [])
app.config["autoapi_add_toctree_entry"] = autoapi.get("add_toctree_entry", True)
app.config["autoapi_member_order"] = autoapi.get("member_order", "bysource")

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

0 comments on commit bd04fb7

Please sign in to comment.