This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git


The following commit(s) were added to refs/heads/trunk by this push:
     new db479629e Try to fix documentation theme on readthedocs.org.
db479629e is described below

commit db479629e1083cae74408f009af9f5f150c2500b
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Jun 18 17:27:49 2024 +0200

    Try to fix documentation theme on readthedocs.org.
---
 .readthedocs.yml |  6 +++---
 docs/conf.py     | 17 ++++++++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/.readthedocs.yml b/.readthedocs.yml
index 97531b13f..5e454ca70 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -23,6 +23,6 @@ formats:
 # Optional but recommended, declare the Python requirements required
 # to build your documentation
 # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
-#python:
-#  install:
-#    - requirements: requirements-rtd.txt
+python:
+  install:
+    - requirements: requirements-rtd.txt
diff --git a/docs/conf.py b/docs/conf.py
index 33584caea..6c01bc8c0 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -21,6 +21,11 @@ import datetime
 from sphinx.ext import apidoc
 from sphinx.domains.python import PythonDomain
 
+try:
+    import sphinx_rtd_theme
+except ImportError:
+    sphinx_rtd_theme = None
+
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
 BASE_DIR = os.path.abspath(BASE_DIR)
 
@@ -114,10 +119,14 @@ pygments_style = "sphinx"
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-import sphinx_rtd_theme
-
 html_theme = "sphinx_rtd_theme"
-html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+
+if sphinx_rtd_theme:
+    html_theme = "sphinx_rtd_theme"
+    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+else:
+    html_theme = "default"
+
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
@@ -321,10 +330,12 @@ def linkify_issues_in_changelog(app, docname, source):
 
         def linkify_github_issues(match):
             url = "https://github.com/apache/libcloud/issues/"; + match[1]
+
             return f"`{match[0]} <{url}>`_"
 
         def linkify_jira_issues(match):
             url = "https://issues.apache.org/jira/browse/LIBCLOUD-"; + match[1]
+
             return f"`{match[0]} <{url}>`_"
 
         linkified_changelog = re.sub(r"(?:PR)?#([0-9]+)\b", 
linkify_github_issues, changelog)

Reply via email to