doc: open external links in a new window

This adds a hack to open external links in a new window. Requires Sphinx v1.8.
This commit is contained in:
David Lechner
2021-01-26 08:30:48 +01:00
committed by laurensvalk
parent 0466ce947f
commit adf6e03bc9
5 changed files with 20 additions and 10 deletions
+4
View File
@@ -0,0 +1,4 @@
// https://stackoverflow.com/a/62742435/1976323
$(document).ready(function () {
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
});
+5
View File
@@ -143,6 +143,11 @@ else:
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# a little extra javascript
html_js_files = [
'js/custom.js'
]
html_context = {
'disclaimer': _DISCLAIMER,
}
Generated
+9 -8
View File
@@ -284,15 +284,15 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]]
name = "snowballstemmer"
version = "2.0.0"
description = "This package provides 26 stemmers for 25 languages generated from Snowball algorithms."
version = "2.1.0"
description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms."
category = "dev"
optional = false
python-versions = "*"
[[package]]
name = "sphinx"
version = "1.7.9"
version = "1.8.5"
description = "Python documentation generator"
category = "dev"
optional = false
@@ -405,7 +405,7 @@ socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"]
[metadata]
lock-version = "1.1"
python-versions = "^3.8"
content-hash = "fed1de01e5e5b8a4350a07325982ee7dc3cca79e5e45029735ce104b29a5da55"
content-hash = "383f496c8938184431ac13f3086cc28e4601e4f07b121dc98ff1f1752ed0cf11"
[metadata.files]
alabaster = [
@@ -421,6 +421,7 @@ babel = [
{file = "Babel-2.9.0.tar.gz", hash = "sha256:da031ab54472314f210b0adcff1588ee5d1d1d0ba4dbd07b94dba82bde791e05"},
]
black = [
{file = "black-20.8b1-py3-none-any.whl", hash = "sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b"},
{file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"},
]
certifi = [
@@ -593,12 +594,12 @@ six = [
{file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"},
]
snowballstemmer = [
{file = "snowballstemmer-2.0.0-py2.py3-none-any.whl", hash = "sha256:209f257d7533fdb3cb73bdbd24f436239ca3b2fa67d56f6ff88e86be08cc5ef0"},
{file = "snowballstemmer-2.0.0.tar.gz", hash = "sha256:df3bac3df4c2c01363f3dd2cfa78cce2840a79b9f1c2d2de9ce8d31683992f52"},
{file = "snowballstemmer-2.1.0-py2.py3-none-any.whl", hash = "sha256:b51b447bea85f9968c13b650126a888aabd4cb4463fca868ec596826325dedc2"},
{file = "snowballstemmer-2.1.0.tar.gz", hash = "sha256:e997baa4f2e9139951b6f4c631bad912dfd3c792467e2f03d7239464af90e914"},
]
sphinx = [
{file = "Sphinx-1.7.9-py2.py3-none-any.whl", hash = "sha256:a602513f385f1d5785ff1ca420d9c7eb1a1b63381733b2f0ea8188a391314a86"},
{file = "Sphinx-1.7.9.tar.gz", hash = "sha256:217a7705adcb573da5bbe1e0f5cab4fa0bd89fd9342c9159121746f593c2d5a4"},
{file = "Sphinx-1.8.5-py2.py3-none-any.whl", hash = "sha256:9f3e17c64b34afc653d7c5ec95766e03043cc6d80b0de224f59b6b6e19d37c3c"},
{file = "Sphinx-1.8.5.tar.gz", hash = "sha256:c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08"},
]
sphinx-rtd-theme = [
{file = "sphinx_rtd_theme-0.4.3-py2.py3-none-any.whl", hash = "sha256:00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4"},
+1 -1
View File
@@ -22,7 +22,7 @@ python = "^3.8"
black = {version = "^20.8b1", allow-prereleases = true}
doc8 = "*"
flake8 = "*"
sphinx = "==1.7.9"
sphinx = "==1.8.5"
sphinx-rtd-theme = "==0.4.3"
toml = "^0.10.0"
+1 -1
View File
@@ -1,5 +1,5 @@
# This file is strictly for building docs on readthedocs.org
# See pyproject.toml for local development
Sphinx==1.7.9
Sphinx==1.8.5
sphinx-rtd-theme==0.4.3
toml