Skip to content

Commit 96a4b94

Browse files
committed
doc_builder: make it possible to use a different default theme
1 parent 613d97e commit 96a4b94

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

readthedocs/doc_builder/backends/sphinx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def get_config_params(self):
9898
downloads = api.version(self.version.pk).get()['downloads']
9999

100100
data = {
101+
'html_theme': 'sphinx_rtd_theme',
102+
'html_theme_import': 'sphinx_rtd_theme',
101103
'current_version': self.version.verbose_name,
102104
'project': self.project,
103105
'version': self.version,

readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#
1515

1616

17+
import importlib
1718
import sys
1819
import os.path
1920
from six import string_types
@@ -48,14 +49,14 @@ using_rtd_theme = (
4849
) or 'html_theme' not in globals()
4950
)
5051
if using_rtd_theme:
51-
import sphinx_rtd_theme
52-
html_theme = 'sphinx_rtd_theme'
52+
theme = importlib.import_module('{{ html_theme_import }}')
53+
html_theme = '{{ html_theme }}'
5354
html_style = None
5455
html_theme_options = {}
5556
if 'html_theme_path' in globals():
56-
html_theme_path.append(sphinx_rtd_theme.get_html_theme_path())
57+
html_theme_path.append(theme.get_html_theme_path())
5758
else:
58-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
59+
html_theme_path = [theme.get_html_theme_path()]
5960

6061
if globals().get('websupport2_base_url', False):
6162
websupport2_base_url = '{{ api_host }}/websupport'

0 commit comments

Comments
 (0)