Skip to content

Commit

Permalink
Use genno.compat.sphinx.rewrite_refs
Browse files Browse the repository at this point in the history
…to resolve references to genno.Quantity & co.
  • Loading branch information
khaeru committed Mar 27, 2024
1 parent ba5b2cb commit 74c484e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
]

Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 74c484e

Please sign in to comment.