Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Commit 8794cde

Browse files
committed
Merge branch 'main' into default-to-proxied-api
2 parents f6e533f + b4b5cf4 commit 8794cde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1241
-655
lines changed

.circleci/config.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: 2.1
2+
3+
commands:
4+
run-tox:
5+
description: "Run tox"
6+
parameters:
7+
version:
8+
type: string
9+
sphinx-version:
10+
type: string
11+
default: "18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,43,44,45,50,latest"
12+
steps:
13+
- checkout
14+
# Tox >=4 fails with `ValueError: py310-sphinx{18`
15+
- run: pip install --user 'tox<4'
16+
- run: tox -e "<<parameters.version>>-sphinx{<<parameters.sphinx-version>>}"
17+
18+
jobs:
19+
py38:
20+
docker:
21+
- image: 'cimg/python:3.8'
22+
steps:
23+
- run-tox:
24+
version: py38
25+
26+
py39:
27+
docker:
28+
- image: 'cimg/python:3.9'
29+
steps:
30+
- run-tox:
31+
version: py39
32+
33+
py310:
34+
docker:
35+
- image: 'cimg/python:3.10'
36+
steps:
37+
- run-tox:
38+
version: py310
39+
# Do not run tests for Python 3.10 and some versions of Sphinx because it's broken
40+
# See https://github.com/sphinx-doc/sphinx/issues/9816
41+
sphinx-version: "18,20,21,22,23,24,42,43,44,45,50,latest"
42+
43+
workflows:
44+
version: 2
45+
test:
46+
jobs:
47+
- py38
48+
- py39
49+
- py310
50+

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @readthedocs/backend
2+
/docs/ @readthedocs/advocacy

.github/workflows/pip-tools.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Action to run pip-compile weekly and create a Pull Request with the changes.
2+
# Althought GitHub says that pip-compile is supported by dependabot, we couldn't make it work together.
3+
# That's why this action exists.
4+
# If we ever find the proper configuration for dependabot+pip-compile,
5+
# we can delete this action.
6+
7+
name: Update dependencies with pip-tools
8+
9+
on:
10+
schedule:
11+
# Run weekly on Mondays at 00:00 UTC
12+
- cron: "0 0 * * 1"
13+
14+
jobs:
15+
update-dependencies:
16+
name: Update dependencies
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-python@v3
21+
with:
22+
python-version: "3.10"
23+
- name: Install test dependencies
24+
run: python -m pip install -U pip-tools
25+
- name: Run pip-compile
26+
run: pip-compile --upgrade --extra=doc --output-file=docs/requirements.txt pyproject.toml
27+
- name: Create Pull Request
28+
uses: peter-evans/create-pull-request@v4
29+
with:
30+
add-paths: |
31+
docs/requirements.txt
32+
title: |
33+
Dependencies: all packages updated via pip-tools
34+
body: |
35+
Dependencies: all packages updated via pip-tools
36+
commit-message: |
37+
Dependencies: all packages updated via pip-tools
38+
delete-branch: true
39+
branch: dependencies/pip-tools
40+
branch-suffix: short-commit-hash
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Read the Docs Pull Request Preview
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
pr-preview-links-community:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: readthedocs/actions/preview@v1
15+
with:
16+
project-slug: "sphinx-hoverxref"
17+
18+
pr-preview-links-business:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: readthedocs/actions/preview@v1
22+
with:
23+
project-slug: "read-the-docs-sphinx-hoverxref"
24+
platform: "business"

.pyup.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22

33
python:
4-
version: 3
4+
version: "3.8"
55
install:
66
- method: pip
77
path: .

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Changelog
2+
=========
3+
4+
This page shows all the changes done on each version.
5+
6+
Version 1.3.0
7+
-------------
8+
9+
* Handle explicit intersphinx inventory names in all domains --not just ``std`` (https://github.com/readthedocs/sphinx-hoverxref/pull/236)
10+
11+
Version 1.2.0
12+
-------------
13+
14+
* New config ``hoverxref_tooltip_lazy`` to improve large page experience (https://github.com/readthedocs/sphinx-hoverxref/pull/227/)
15+
16+
Version 1.1.3
17+
-------------
18+
19+
* Ignore ``pending_xref`` (missing references) that don't have domains (https://github.com/readthedocs/sphinx-hoverxref/pull/210)
20+
21+
Version 1.1.2
22+
-------------
23+
24+
* Prefix all the CSS classes with ``hxr-`` to avoid collisions with other frameworks
25+
26+
Version 1.1.1
27+
-------------
28+
29+
* Fix an issue with intersphinx and domains when the ``reftype`` was unknown
30+
31+
Version 1.1.0
32+
-------------
33+
34+
* Improve intersphinx robustness
35+
* Update all dependencies for building documentation
36+
* Packaging: use bumpver and flit to build/publish
37+
* Improve documentation installing instructions
38+
* Setup pip-tools together with dependabot to handle dependencies updates
39+
* Remove tests for Python 3.6 and Python 3.7 and add newer Sphinx versions (4.4, 4.5 and 5.0)
40+
41+
Version 1.0.1
42+
-------------
43+
44+
* Ajax header: send the header on each call instead with .ajaxSetup (https://github.com/readthedocs/sphinx-hoverxref/pull/167)
45+
* Tests: solve problem with RTD documentation's title (https://github.com/readthedocs/sphinx-hoverxref/pull/168)
46+
47+
Version 1.0.0
48+
-------------
49+
50+
* Official release
51+
52+
Version 0.9b1
53+
-------------
54+
55+
* Send ``X-HoverXRef-Version`` HTTP header when hitting the API
56+
57+
58+
Version 0.8b1
59+
-------------
60+
61+
* Move from TravisCI to CircleCI
62+
* Use Read the Docs' Embed APIv3
63+
* Stop adding ``data-`` attributes to HTML nodes
64+
* Do not require ``hoverxref_project`` and ``hoverxref_version`` defined anymore
65+
* Simplify code by removing ``HoverXRefHTMLTranslatorMixin`` override required and utils functions to get xref data
66+
* Add new config ``hoverxref_sphinx_version`` used to send to Embed APIv3
67+
* Update all Python requirements
68+
* Remove via Javascript the ``title=`` property on Intersphinx references
69+
* Support for ``glossary``/``term`` added
70+
* Support for ``sphinxcontrib-bibtex`` added
71+
* Improve documentation to show examples of documentation not hosted on Read the Docs
72+
* Use regular expressions on tests to allow partial matching when required

MANIFEST.in

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ sphinx-hoverxref
55

66
``sphinx-hoverxref`` is a Sphinx_ extension to add tooltips on the cross references of the documentation with the content of the linked section.
77

8-
.. warning::
9-
10-
This extension is currently in Beta state.
11-
This means that there may be some things not well supported or unexpected behavior.
12-
If you find any issue, please `report it in the issue tracker <https://github.com/readthedocs/sphinx-hoverxref/issues>`_.
13-
148

159
Example
1610
-------
@@ -21,9 +15,17 @@ Example
2115
Installation
2216
------------
2317

18+
You can install sphinx-hoverxref from PyPI:
19+
20+
::
21+
22+
pip install sphinx-hoverxref
23+
24+
Or, alternatively, install it from GitHub directly (requires git):
25+
2426
::
2527

26-
pip install git+https://github.com/readthedocs/sphinx-hoverxref@master
28+
pip install git+https://github.com/readthedocs/sphinx-hoverxref
2729

2830

2931
Configuration

docs/conf.py

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#
1313
import os
1414
import datetime
15-
# import sys
16-
# sys.path.insert(0, os.path.abspath('.'))
15+
import sys
16+
sys.path.insert(0, os.path.abspath('..'))
1717

1818

1919
# -- Project information -----------------------------------------------------
@@ -48,15 +48,25 @@
4848
'hoverxref.extension',
4949
'versionwarning.extension',
5050
'notfound.extension',
51+
'sphinxcontrib.bibtex',
52+
'sphinxemoji.sphinxemoji',
5153
]
5254

55+
bibtex_bibfiles = ['refs.bib']
56+
5357
intersphinx_mapping = {
5458
'readthedocs': ('https://docs.readthedocs.io/en/stable/', None),
5559
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
60+
'sympy': ('https://docs.sympy.org/latest/', None),
61+
'numpy': ('https://numpy.org/doc/stable/', None),
62+
'python': ('https://docs.python.org/3/', None),
5663
}
5764
hoverxref_intersphinx = [
5865
'readthedocs',
5966
'sphinx',
67+
'sympy',
68+
'numpy',
69+
'python',
6070
]
6171
hoverxref_intersphinx_types = {
6272
'readthedocs': 'modal',
@@ -67,10 +77,23 @@
6777
if os.environ.get('READTHEDOCS') != 'True':
6878
hoverxref_api_host = 'https://readthedocs.org'
6979

80+
if os.environ.get('PROXIED_API_ENDPOINT') == 'True':
81+
# Use the proxied API endpoint
82+
hoverxref_api_host = '/_'
83+
84+
if os.environ.get('LOCAL_READTHEDOCS') == 'True':
85+
# Building on a local Read the Docs instance
86+
hoverxref_api_host = 'http://community.dev.readthedocs.io'
87+
88+
if os.environ.get('NGROK_READTHEDOCS') == 'True':
89+
# Building on a local Read the Docs instance using NGROK for HTTPS
90+
hoverxref_api_host = 'https://readthedocs.ngrok.io'
91+
7092
hoverxref_tooltip_maxwidth = 650
7193
hoverxref_auto_ref = True
7294
hoverxref_roles = [
7395
'confval',
96+
'term',
7497
]
7598

7699
hoverxref_role_types = {
@@ -79,21 +102,15 @@
79102
'confval': 'tooltip',
80103
'mod': 'modal',
81104
'class': 'modal',
105+
'obj': 'tooltip',
82106
}
83107
hoverxref_domains = [
84108
'py',
109+
'cite',
85110
]
86111
hoverxref_sphinxtabs = True
87112
hoverxref_mathjax = True
88113

89-
versionwarning_messages = {
90-
'latest': 'This extension is currently in Beta state. '
91-
'This means that there may be some things not well supported or unexpected behavior. '
92-
'If you find any issue, please <a href="https://github.com/readthedocs/sphinx-hoverxref/issues">report it in the issue tracker</a>.'
93-
}
94-
versionwarning_banner_title = 'We are in Beta!'
95-
versionwarning_body_selector = 'div[itemprop="articleBody"]'
96-
97114
autosectionlabel_prefix_document = True
98115

99116
autoapi_dirs = ['../hoverxref']
@@ -116,7 +133,7 @@
116133
#
117134
# This is also used if you do content translation via gettext catalogs.
118135
# Usually you set "language" from the command line for these cases.
119-
language = None
136+
language = "en"
120137

121138
# List of patterns, relative to source directory, that match files and
122139
# directories to ignore when looking for source files.

0 commit comments

Comments
 (0)