diff --git a/docs/conf.py b/docs/conf.py index aee1de36d1..ecc8f67b2b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,14 @@ import sys, os from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "https://docs.sylius.com") + +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + if "html_context" not in globals(): + html_context = {} + html_context["READTHEDOCS"] = True + extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', @@ -21,8 +29,10 @@ copyright = u'2011-2024, Sylius Sp. z o.o.' version = '' release = '' exclude_patterns = ['_includes/*.rst'] -html_theme = 'sylius_rtd_theme' +html_theme = "sylius_rtd_theme" html_theme_path = ["_themes"] +html_context = html_context if 'html_context' in globals() else {} +html_context['style'] = 'css/theme.css' html_favicon = 'favicon.ico' htmlhelp_basename = 'Syliusdoc' man_pages = [ diff --git a/docs/requirements.txt b/docs/requirements.txt index d0439b1334..6f8f2433a9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,8 +1,8 @@ -sphinx==1.8.5 -alabaster==0.7.13 -docutils<0.18 -jinja2==3.0.0 -pyOpenSSL -requests[security] -sphinx-copybutton -sphinx-autobuild +sphinx>=7.0.1 +alabaster>=0.7.13 +docutils>=0.18.1,<0.21 +jinja2>=3.0.0,<4.0 +pyOpenSSL>=21.0.0 +requests[security]>=2.25.0 +sphinx-copybutton>=0.5.0 +sphinx-autobuild>=2021.3.14