File: installation.rst

package info (click to toggle)
sphinx-hoverxref 1.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,296 kB
  • sloc: javascript: 2,538; python: 912; makefile: 16
file content (51 lines) | stat: -rw-r--r-- 1,407 bytes parent folder | download
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
Installation
============

Install the package

.. tabs::

   .. tab:: from PyPI

      .. prompt:: bash

         pip install sphinx-hoverxref

   .. tab:: from GitHub

      .. prompt:: bash

         pip install git+https://github.com/readthedocs/sphinx-hoverxref


Once we have the package installed,
we have to configure it on our Sphinx documentation.
To do this, add this extension to your Sphinx's extensions in the ``conf.py`` file.

.. code-block:: python

   # conf.py
   extensions = [
        # ... other extensions here
        'hoverxref.extension',
   ]


After installing the package and adding the extension in the ``conf.py`` file,
you can use ``:hoverxref:`` role to show a tooltip [#]_ when hovering with the mouse.

.. warning::

   This extension **requires a backend server** to retrieve the tooltip content.
   Currently, only `Read the Docs`_ is supported as backend server.
   Take into account that your documentation has to be hosted on Read the Docs for this extension to work.

If you prefer to apply this behavior to *all* your ``:ref:`` in your documentation,
you can use the config :confval:`hoverxref_auto_ref`.

See :ref:`usage:usage` for more use cases and :ref:`configuration:configuration` for a full list of available configs.


.. _Read the Docs: https://readthedocs.org/

.. [#] we use tooltips as a generic word, but we refer to both, tooltips and modal dialogues