Skip to content

Commit 00aabaa

Browse files
RDaxiniechedey-ls
andauthored
Implement hoverxref for floating tooltips (#2290)
* Update conf.py * example/test * Update readthedocs.yml * undo * add extension to conf.py * Update readthedocs.yml * Update readthedocs.yml * ci/requirements * undo * Update requirements-py3.9.yml * (try again) installing hoverxref * add dependency * Update conf.py * enable tooltip for multiple roles * add py * add autoref (again) * Update docs/sphinx/source/conf.py Co-authored-by: Echedey Luis <[email protected]> * Revert "Update docs/sphinx/source/conf.py" This reverts commit d4a0241. * Reapply "Update docs/sphinx/source/conf.py" This reverts commit 6ea834f. * try hoverxref_domains * try py: * Update conf.py * Update conf.py * intersphinx mapping * remove duplicate intersphinx --------- Co-authored-by: Echedey Luis <[email protected]>
1 parent a05e0c4 commit 00aabaa

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

docs/sphinx/source/conf.py

+17-9
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,28 @@
5656
'sphinx_gallery.gen_gallery',
5757
'sphinx_toggleprompt',
5858
'sphinx_favicon',
59+
'hoverxref.extension',
5960
]
6061

6162
mathjax3_config = {'chtml': {'displayAlign': 'left',
6263
'displayIndent': '2em'}}
6364

65+
# Example configuration for intersphinx: refer to the Python standard library.
66+
intersphinx_mapping = {
67+
'python': ('https://docs.python.org/3/', None),
68+
'numpy': ('https://numpy.org/doc/stable/', None),
69+
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
70+
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
71+
'matplotlib': ('https://matplotlib.org/stable', None),
72+
}
73+
74+
# Enable hover tooltips
75+
hoverxref_auto_ref = True
76+
hoverxref_roles = ["class", "meth", "func", "ref", "term"]
77+
hoverxref_role_types = dict.fromkeys(hoverxref_roles, "tooltip")
78+
hoverxref_domains = ["py"]
79+
hoverxref_intersphinx = list(intersphinx_mapping.keys())
80+
6481
napoleon_use_rtype = False # group rtype on same line together with return
6582

6683
# Add any paths that contain templates here, relative to this directory.
@@ -357,15 +374,6 @@ def setup(app):
357374
# If true, do not generate a @detailmenu in the "Top" node's menu.
358375
# texinfo_no_detailmenu = False
359376

360-
# Example configuration for intersphinx: refer to the Python standard library.
361-
intersphinx_mapping = {
362-
'python': ('https://docs.python.org/3/', None),
363-
'numpy': ('https://numpy.org/doc/stable/', None),
364-
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
365-
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
366-
'matplotlib': ('https://matplotlib.org/stable', None),
367-
}
368-
369377
ipython_warning_is_error = False
370378

371379
# suppress "WARNING: Footnote [1] is not referenced." messages

pvlib/irradiance.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def beam_component(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
244244
solar_azimuth : numeric
245245
Solar azimuth angle.
246246
dni : numeric
247-
Direct Normal Irradiance
247+
Direct normal irradiance, see :term:`dni`. [Wm⁻²]
248248
249249
Returns
250250
-------

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ doc = [
6666
'sphinx-toggleprompt == 0.5.2',
6767
'sphinx-favicon',
6868
'solarfactors',
69+
'sphinx-hoverxref',
6970
]
7071
test = [
7172
'pytest',

0 commit comments

Comments
 (0)