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

Commit 7932743

Browse files
authored
Merge branch 'master' into humitos/update-test-suite
2 parents c47c0f5 + ef146e4 commit 7932743

File tree

10 files changed

+41
-16
lines changed

10 files changed

+41
-16
lines changed

.circleci/config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ commands:
88
type: string
99
sphinx-version:
1010
type: string
11-
default: "18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,latest"
11+
default: "18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,43,latest"
1212
steps:
1313
- checkout
1414
- run: pip install --user tox
@@ -50,7 +50,7 @@ jobs:
5050
version: py310
5151
# Do not run tests for Python 3.10 and some versions of Sphinx because it's broken
5252
# See https://github.com/sphinx-doc/sphinx/issues/9816
53-
sphinx-version: "18,20,21,22,23,24,42,latest"
53+
sphinx-version: "18,20,21,22,23,24,42,43,latest"
5454

5555
workflows:
5656
version: 2
@@ -61,3 +61,4 @@ workflows:
6161
- py38
6262
- py39
6363
- py310
64+

CHANGELOG.rst

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ Changelog
33

44
This page shows all the changes done on each version.
55

6+
Version 1.0.0
7+
-------------
8+
9+
* Official release
10+
11+
Version 0.9b1
12+
-------------
13+
14+
* Send ``X-HoverXRef-Version`` HTTP header when hitting the API
15+
616

717
Version 0.8b1
818
-------------

README.rst

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ Example
2121
Installation
2222
------------
2323

24+
You can install sphinx-hoverxref from PyPI:
25+
26+
::
27+
28+
pip install sphinx-hoverxref
29+
30+
Or, alternatively, install it from GitHub directly (requires git):
31+
2432
::
2533

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

docs/conf.py

-8
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@
116116
hoverxref_sphinxtabs = True
117117
hoverxref_mathjax = True
118118

119-
versionwarning_messages = {
120-
'latest': 'This extension is currently in Beta state. '
121-
'This means that there may be some things not well supported or unexpected behavior. '
122-
'If you find any issue, please <a href="https://github.com/readthedocs/sphinx-hoverxref/issues">report it in the issue tracker</a>.'
123-
}
124-
versionwarning_banner_title = 'We are in Beta!'
125-
versionwarning_body_selector = 'div[itemprop="articleBody"]'
126-
127119
autosectionlabel_prefix_document = True
128120

129121
autoapi_dirs = ['../hoverxref']

docs/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
sphinx==4.2.0
1+
sphinx==4.3.1
22
sphinx-autoapi==1.8.4
33
sphinx-rtd-theme==1.0.0
44
sphinx-tabs==3.2.0
55
sphinx-prompt==1.4.0
66
sphinx-version-warning==1.1.2
7-
sphinx-notfound-page==0.7.1
7+
sphinx-notfound-page==0.8
88
sphinx-autobuild==2021.3.14
99
sphinxcontrib-bibtex==2.4.1

hoverxref/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '0.8b1'
1+
version = '1.0.0'

hoverxref/_static/js/hoverxref.js_t

+7
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ function getEmbedURL(url) {
9393

9494

9595
$(document).ready(function() {
96+
// Define a custom HTTP header to send the requests to the server
97+
$.ajaxSetup({
98+
beforeSend: function(request) {
99+
request.setRequestHeader('X-HoverXRef-Version', '{{ http_hoverxref_version }}');
100+
}
101+
});
102+
96103
// Remove ``title=`` attribute for intersphinx nodes that have hoverxref enabled.
97104
// It doesn't make sense the browser shows the default tooltip (browser's built-in)
98105
// and immediately after that our tooltip was shown.

hoverxref/extension.py

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def copy_asset_files(app, exception):
6565
# Then, add the values that the user overrides
6666
context[attr] = getattr(app.config, attr)
6767

68+
context['http_hoverxref_version'] = version
69+
6870
# Finally, add some non-hoverxref extra configs
6971
configs = ['html_theme']
7072
for attr in configs:

tests/test_htmltag.py

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import sphinx
44
import textwrap
55

6+
from hoverxref import version
7+
68
from .utils import srcdir, prefixdocumentsrcdir, customobjectsrcdir, pythondomainsrcdir, intersphinxsrc, bibtexdomainsrcdir
79

810

@@ -55,6 +57,7 @@ def test_js_render(app, status, warning):
5557
"var sphinxtabs = false",
5658
"var mathjax = false",
5759
"var url = getEmbedURL(href);",
60+
f"request.setRequestHeader('X-HoverXRef-Version', '{version}');",
5861
]
5962

6063
for chunk in chunks:

tox.ini

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[tox]
22
envlist =
33
docs
4-
py{36,37,38,39}-sphinx{18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,latest}
5-
py{310}-sphinx{18,20,21,22,23,24,42,latest}
4+
py{36,37,38,39}-sphinx{18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,43,latest}
5+
py{310}-sphinx{18,20,21,22,23,24,42,43,latest}
66

77
[testenv]
88
deps =
@@ -25,7 +25,9 @@ deps =
2525
sphinx40: sphinx~=4.0.0
2626
sphinx41: sphinx~=4.1.0
2727
sphinx42: sphinx~=4.2.0
28+
sphinx43: sphinx~=4.3.0
2829
sphinxlatest: sphinx
30+
2931
commands = pytest {posargs}
3032

3133
# Pin docutils<0.18 for all Python versions using Sphinx 1.x, 2.x, 3.x, 4.0, 4.1
@@ -36,7 +38,7 @@ deps =
3638
{[testenv]deps}
3739
docutils<0.18
3840

39-
[testenv:py310-sphinx42]
41+
[testenv:py310-sphinx43]
4042
deps =
4143
{[testenv]deps}
4244
pytest-cov

0 commit comments

Comments
 (0)