Skip to content

Commit

Permalink
Merge pull request #138 from daltzctr/rtd-injection-deprecation
Browse files Browse the repository at this point in the history
Address the readthedocs injection deprecation
  • Loading branch information
daltzctr authored Nov 6, 2024
2 parents 41bc31b + eb4eace commit 4cbab64
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
36 changes: 28 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ docutils = "==0.20.1"
fonttools = {version = "==4.33.3", extras = ["woff"]}
latex = "==0.7.0"
packaging = "==24.1"
readthedocs-sphinx-ext = "^2"
sphinx = "==7.3.7"
sphinx-rtd-theme = {git = "https://github.com/readthedocs/sphinx_rtd_theme.git", rev = "357e76dc42a89c1c387cafd8cb134378a57e4d6d"}
sphinx-hoverxref = "==1.0.1"
sphinx-notfound-page = "==1.0.2"
sphinx-rtd-theme = "==2.0.0"
sphinx-tabs = "==3.4.5"
sphinx-version-warning = "==1.1.2"
sphinxcontrib-ghcontributors = "==0.2.3"
Expand Down
6 changes: 6 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
on_rtd = os.environ.get('READTHEDOCS') == 'True'

if on_rtd:
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
notfound_no_urls_prefix = False
else:
notfound_no_urls_prefix = True
Expand Down Expand Up @@ -134,6 +135,11 @@
html_static_path = ['_static']
html_logo = 'img/ctre.png'

if on_rtd:
html_context = {
"READTHEDOCS": True
}

# Theme tweaks on top of RTD
def setup(app):
app.add_css_file('css/theme_ctre.css')
Expand Down
3 changes: 2 additions & 1 deletion source/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pbr==6.0.0 ; python_version >= "3.9" and python_version < "4.0"
pycparser==2.22 ; platform_python_implementation != "CPython" and python_version >= "3.9" and python_version < "4.0"
pygments==2.18.0 ; python_version >= "3.9" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.9" and python_version < "4.0"
readthedocs-sphinx-ext==2.2.5 ; python_version >= "3.9" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.9" and python_version < "4.0"
restructuredtext-lint==1.4.0 ; python_version >= "3.9" and python_version < "4.0"
shutilwhich==1.1.0 ; python_version >= "3.9" and python_version < "4.0"
Expand All @@ -38,7 +39,7 @@ smmap==5.0.1 ; python_version >= "3.9" and python_version < "4.0"
snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "4.0"
sphinx-hoverxref==1.0.1 ; python_version >= "3.9" and python_version < "4.0"
sphinx-notfound-page==1.0.2 ; python_version >= "3.9" and python_version < "4.0"
sphinx-rtd-theme==2.0.0 ; python_version >= "3.9" and python_version < "4.0"
sphinx-rtd-theme @ git+https://github.com/readthedocs/sphinx_rtd_theme.git@357e76dc42a89c1c387cafd8cb134378a57e4d6d ; python_version >= "3.9" and python_version < "4.0"
sphinx-tabs==3.4.5 ; python_version >= "3.9" and python_version < "4.0"
sphinx-version-warning==1.1.2 ; python_version >= "3.9" and python_version < "4.0"
sphinx==7.3.7 ; python_version >= "3.9" and python_version < "4.0"
Expand Down

0 comments on commit 4cbab64

Please sign in to comment.