diff --git a/doc/conf.py b/doc/conf.py index f04ae1efb..9bec971ed 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -19,7 +19,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions coming # with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ - "ixmp.util.sphinx_linkcode_github", + # First party "sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.coverage", @@ -29,6 +29,9 @@ "sphinx.ext.mathjax", "sphinx.ext.napoleon", "sphinx.ext.todo", + # Others + "ixmp.util.sphinx_linkcode_github", + "genno.compat.sphinx.rewrite_refs", "sphinxcontrib.bibtex", ] @@ -77,6 +80,14 @@ # The theme to use for HTML and HTML Help pages. html_theme = "sphinx_rtd_theme" +# -- Options for genno.compat.sphinx.rewrite_refs -------------------------------------- + +reference_aliases = { + r"(genno\.|)Quantity": "genno.core.attrseries.AttrSeries", + "AnyQuantity": ":data:`genno.core.quantity.AnyQuantity`", +} + + # -- Options for sphinx.ext.extlinks --------------------------------------------------- extlinks = { diff --git a/pyproject.toml b/pyproject.toml index 3ae146586..06816f320 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,7 @@ documentation = "https://docs.messageix.org/ixmp" [project.optional-dependencies] docs = [ "ixmp[tests]", + "genno >= 1.26", # For sphinx extensions; see doc/conf.py "GitPython", "numpydoc", "sphinx >= 3.0",