Skip to content

Commit 2147cec

Browse files
committed
Add hoverxref to our docs
1 parent 6052f90 commit 2147cec

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/conf.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ def get_version():
3434
'sphinx-prompt',
3535
'recommonmark',
3636
'notfound.extension',
37+
'hoverxref.extension',
3738
'sphinx_search.extension',
3839
]
39-
templates_path = ['_templates']
4040

41+
templates_path = ['_templates']
4142
source_suffix = ['.rst', '.md']
4243

4344
master_doc = 'index'
@@ -85,6 +86,21 @@ def get_version():
8586
'display_version': False,
8687
}
8788

89+
hoverxref_auto_ref = True
90+
hoverxref_domains = ['py']
91+
hoverxref_roles = [
92+
'option',
93+
'doc',
94+
]
95+
hoverxref_role_types = {
96+
'mod': 'modal', # for Python Sphinx Domain
97+
'doc': 'modal', # for whole docs
98+
'class': 'tooltip', # for Python Sphinx Domain
99+
'ref': 'tooltip', # for hoverxref_auto_ref config
100+
'confval': 'tooltip', # for custom object
101+
}
102+
103+
88104
# Activate autosectionlabel plugin
89105
autosectionlabel_prefix_document = True
90106

requirements/local-docs-build.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ git+https://github.com/agjohnson/sphinx-intl.git@7b5c66bdb30f872b3b1286e371f569c
1919
# Test out in-doc search
2020
git+https://github.com/readthedocs/readthedocs-sphinx-search@master
2121

22+
# Test out hoverxref
23+
git+https://github.com/readthedocs/sphinx-hoverxref@master
24+
2225

2326
Pygments==2.6.1
2427

0 commit comments

Comments
 (0)