Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: change the api layout to autoapi layout. #3708

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,4 @@ model.index\+
# local environment settings used by e.g. Visual Studio Code
/.env
/doc/source/local_config.json
doc/source/API/
54 changes: 39 additions & 15 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
get_version_match, pyansys_logo_black,
watermark,
ansys_logo_white,
ansys_logo_white_cropped, latex)
ansys_logo_white_cropped, latex,
get_autoapi_templates_dir_relative_path)
from importlib import import_module
from pprint import pformat
from docutils.parsers.rst import Directive
Expand Down Expand Up @@ -126,11 +127,12 @@ def setup(app):
"sphinx.ext.inheritance_diagram",
"numpydoc",
"ansys_sphinx_theme.extension.linkcode",
"autoapi.extension",
]

# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"python": ("https://docs.python.org/3.10", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
"numpy": ("https://numpy.org/devdocs", None),
"matplotlib": ("https://matplotlib.org/stable", None),
Expand Down Expand Up @@ -291,18 +293,6 @@ def setup(app):
"run_examples": config["run_examples"],
},
}
# def prepare_jinja_env(jinja_env) -> None:
# """
# Customize the jinja env.
#
# Notes
# -----
# See https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment
# """
# jinja_env.globals["project_name"] = project
#
#
# autoapi_prepare_jinja_env = prepare_jinja_env

# -- Options for HTML output -------------------------------------------------
html_short_title = html_title = "PyAEDT"
Expand Down Expand Up @@ -379,4 +369,38 @@ def setup(app):
author,
"manual",
),
]
]

def prepare_jinja_env(jinja_env) -> None:
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Customize the jinja env.
Customize the Jinja environment.

Customize the jinja env.

Notes
-----
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment
For more information on the ``environment`` class, see `High Level API
<https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment> in the
Jinja documentation."

See https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment
"""
jinja_env.globals["project_name"] = project


autoapi_prepare_jinja_env = prepare_jinja_env


autoapi_type = "python"
autoapi_dirs = ["../../pyaedt/"]
autoapi_options = [
"members",
"undoc-members",
"show-inheritance",
"show-module-summary",
"special-members",
]
autoapi_template_dir = get_autoapi_templates_dir_relative_path(pathlib.Path(__file__))
suppress_warnings = ["autoapi.python_import_resolution"]
exclude_patterns = [
"autoapi",
"**/ExampleData*",
"**/LaunchWorkbench*",
]
autoapi_root = "API"
autoapi_python_use_implicit_namespaces = True
autoapi_render_in_single_page = ["class", "enum", "exception"]
74 changes: 46 additions & 28 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,63 @@ Ansys Electronics Desktop (AEDT) to make scripting simpler.

User guide

.. grid-item-card::
:img-top: _static/assets/index_api.png

API reference
^^^^^^^^^^^^^

.. grid:: 2
Understand PyAEDT EDB API endpoints, their capabilities,
and how to interact with them programmatically.

.. grid-item-card::
:img-top: _static/assets/index_api.png
+++
.. button-link:: API/pyaedt/index.html
:color: secondary
:expand:
:outline:
:click-parent:

AEDT API reference
^^^^^^^^^^^^^^^^^^
EDB API reference

Understand PyAEDT API endpoints, their capabilities,
and how to interact with them programmatically.

+++
.. button-link:: API/index.html
:color: secondary
:expand:
:outline:
:click-parent:
..
.. grid:: 2

AEDT API reference
.. grid-item-card::
:img-top: _static/assets/index_api.png

.. grid-item-card::
:img-top: _static/assets/index_api.png
AEDT API reference
^^^^^^^^^^^^^^^^^^

EDB API reference
^^^^^^^^^^^^^^^^^
Understand PyAEDT API endpoints, their capabilities,
and how to interact with them programmatically.

Understand PyAEDT EDB API endpoints, their capabilities,
and how to interact with them programmatically.
+++
.. button-link:: API/index.html
:color: secondary
:expand:
:outline:
:click-parent:

+++
.. button-link:: EDBAPI/index.html
:color: secondary
:expand:
:outline:
:click-parent:
AEDT API reference

.. grid-item-card::
:img-top: _static/assets/index_api.png

EDB API reference
^^^^^^^^^^^^^^^^^

Understand PyAEDT EDB API endpoints, their capabilities,
and how to interact with them programmatically.

+++
.. button-link:: EDBAPI/index.html
:color: secondary
:expand:
:outline:
:click-parent:

EDB API reference
EDB API reference

.. jinja:: main_toctree

Expand Down Expand Up @@ -138,7 +156,7 @@ Indices and tables

Getting_started/index
User_guide/index
API/index
API/pyaedt/index.html
EDBAPI/index
{% if run_examples %}
examples/index
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ doc = [
"scikit-learn==1.3.1; python_version > '3.7'",
"Sphinx==7.1.2; python_version <= '3.9'",
"Sphinx==7.2.6; python_version >= '3.9'",
"sphinx-autoapi==3.0.0",
"sphinx-autobuild==2021.3.14",
"sphinx-autodoc-typehints==1.24.0",
"sphinx-copybutton==0.5.2",
Expand Down
Loading