Skip to content

Commit

Permalink
docs: adds alt.expr to API Reference
Browse files Browse the repository at this point in the history
Uses the section heading proposed in vega#3427 (comment)

Expands on vega#2904
  • Loading branch information
dangotbanned committed Jul 9, 2024
1 parent fe09616 commit 8a80357
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/user_guide/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,13 @@ Low-Level Schema Wrappers
WindowFieldDef
WindowOnlyOp
WindowTransform

API Utility Classes
-------------------
.. currentmodule:: altair

.. autosummary::
:toctree: generated/api-cls/
:nosignatures:

expr
15 changes: 15 additions & 0 deletions tools/generate_api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@
:nosignatures:
{lowlevel_wrappers}
API Utility Classes
-------------------
.. currentmodule:: altair
.. autosummary::
:toctree: generated/api-cls/
:nosignatures:
{api_classes}
"""


Expand Down Expand Up @@ -104,6 +114,10 @@ def api_functions() -> list[str]:
return sorted(altair_api_functions)


def api_classes() -> list[str]:
return ["expr"]


def lowlevel_wrappers() -> list[str]:
objects = sorted(iter_objects(alt.schema.core, restrict_to_subclass=alt.SchemaBase)) # type: ignore[attr-defined]
# The names of these two classes are also used for classes in alt.channels. Due to
Expand All @@ -124,6 +138,7 @@ def write_api_file() -> None:
api_functions=sep.join(api_functions()),
encoding_wrappers=sep.join(encoding_wrappers()),
lowlevel_wrappers=sep.join(lowlevel_wrappers()),
api_classes=sep.join(api_classes()),
),
encoding="utf-8",
)
Expand Down

0 comments on commit 8a80357

Please sign in to comment.