1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
|
Configuration
=============
The default settings should be enough for most of the cases.
For more specific use cases, you can customize these configuration options in your ``conf.py`` file.
.. contents:: Table of contents
:local:
:backlinks: none
:depth: 1
General settings
----------------
These settings are global and have effect on both, tooltips and modal dialogues.
.. confval:: hoverxref_role_types
Description: Style to use by default when hover each type of reference (role).
Default: ``{}``
Type: dictionary
Example:
.. code-block:: python
{
'hoverxref': 'modal',
'ref': 'modal', # for hoverxref_auto_ref config
'confval': 'tooltip', # for custom object
'mod': 'tooltip', # for Python Sphinx Domain
'class': 'tooltip', # for Python Sphinx Domain
}
.. confval:: hoverxref_default_type
Description: Default style when the specific one was not found in :confval:`hoverxref_role_types`.
Default: ``tooltip``
Options: ``tooltip`` or ``modal``
Type: string
.. confval:: hoverxref_auto_ref
Description: Make all ``:ref:`` role to show a tooltip.
Default: ``False``
Type: bool
.. confval:: hoverxref_ignore_refs
Description: Ignore to add tooltip on specific references. Useful when using :confval:`hoverxref_auto_ref`
Default: ``['genindex', 'modindex', 'search']``
Type: list
.. confval:: hoverxref_domains
Description: List containing the Sphinx Domain's names where ``hoverxref`` has to be applied.
Default: ``[]``
Type: list
.. confval:: hoverxref_roles
Description: List containing roles where ``hoverxref`` has to be applied.
Default: ``[]``
Type: list
Example:
.. code-block:: python
hoverxref_roles = [
'numref',
'confval',
'setting',
]
.. confval:: hoverxref_intersphinx
Description: Enable Sphinx's hoverxref extension on intersphinx targets from ``intersphinx_mapping``.
Default: ``[]``
Type: list
.. warning::
The Sphinx's target project **must be hosted on Read the Docs** to work or,
be one of the allowed external projects:
currently CPython, SymPy, NumPy are supported.
.. confval:: hoverxref_intersphinx_types
Description: Style used for intersphinx links.
Default: ``{}``. It uses :confval:`hoverxref_default_type` if the intersphinx target is not defined in this config.
Type: dict
Example:
.. code-block:: python
{
# make specific links to use a particular tooltip type
'readthdocs': {
'doc': 'modal',
'ref': 'tooltip',
},
'python': {
'class': 'modal',
'ref':, 'tooltip',
},
# make all links for Sphinx to be ``tooltip``
'sphinx': 'tooltip',
}
.. confval:: hoverxref_sphinxtabs
Description: Trigger an extra step to render tooltips where its content has a `Sphinx Tabs`_
Default: ``False``
Type: bool
.. _Sphinx Tabs: https://github.com/djungelorm/sphinx-tabs
.. confval:: hoverxref_mathjax
Description: Trigger an extra step to render tooltips where its content has a `Mathjax`_
Default: ``False``
Type: bool
.. _Mathjax: http://www.sphinx-doc.org/es/master/usage/extensions/math.html#module-sphinx.ext.mathjax
.. confval:: hoverxref_api_host
Description: Host or root URL for the API to retrieve the content of the floating window
.. warning::
You shouldn't modify this setting unless you know what you are doing.
Its default should be fine to build the documentation and make it work in Read the Docs.
Default: ``/_``
Type: string
Tooltipster
-----------
These settings have effect only in tooltips.
.. confval:: hoverxref_tooltip_class
Description: CSS class to add to ``div`` created for the tooltip
Default: ``rst-content``
Type: string
.. confval:: hoverxref_tooltip_lazy
Description: Whether to lazily generate tooltips (insert the HTML for the tooltip on hover, rather than on page load).
This is known to be slower, but prevents the browser from stalling on load for very big doc pages.
We recommend you keeping it as `False` unless you are experiencing page load issues.
Default ``False``
Type: bool
.. warning::
The following settings are passed directly to Tooltipster_.
See `its options <https://www.heteroclito.fr/modules/tooltipster/#options>`_ for more information about their descriptions.
.. confval:: hoverxref_tooltip_theme
Default: ``['tooltipster-shadow', 'tooltipster-shadow-custom']``
Type: list of strings
.. confval:: hoverxref_tooltip_interactive
Default: ``True``
Type: bool
.. confval:: hoverxref_tooltip_maxwith
Default: ``450``
Type: int
.. confval:: hoverxref_tooltip_side
Default: ``right``
Type: string
.. confval:: hoverxref_tooltip_animation
Default: ``fade``
Type: string
.. confval:: hoverxref_tooltip_animation_duration
Default: ``0``
Type: int
.. confval:: hoverxref_tooltip_content
Default: ``Loading...``
Type: string
.. _Tooltipster: https://www.heteroclito.fr/modules/tooltipster/
MicroModal.js
-------------
These settings have effect only in modal dialogues.
.. confval:: hoverxref_modal_hover_delay
Description: Delay time (in milliseconds) before showing the modal when hover over a ref
Default: ``350``
Type: int
.. confval:: hoverxref_modal_default_title
Description: Title shown when the content does not have one
Default: ``Note``
Type: string
.. confval:: hoverxref_modal_prefix_title
Description: Prefix included in the title of the modal
Default: 📝 (ends with a trailing space)
Type: string
.. confval:: hoverxref_modal_class
Description:
Default: ``rst-content``
Type: string
.. warning::
The following settings are passed directly to `MicroModal.js`_.
See https://micromodal.now.sh/#configuration for more information about their descriptions.
.. confval:: hoverxref_modal_onshow_function
Default: ``None``
Type: string
.. confval:: hoverxref_modal_openclass
Default: ``is-open``
Type: string
.. confval:: hoverxref_modal_disable_focus
Default: ``True``
Type: bool
.. confval:: hoverxref_modal_disable_scroll
Default: ``False``
Type: bool
.. confval:: hoverxref_modal_awaitopenanimation
Default: ``False``
Type: bool
.. confval:: hoverxref_modal_awaitcloseanimation
Default: ``False``
Type: bool
.. confval:: hoverxref_modal_debugmode
Default: ``False``
Type: bool
|