Skip to content

Commit 011634b

Browse files
author
Feanil Patel
authored
Merge pull request #86 from open-craft/kshitij/switch-to-sphinx-book-theme
chore: Switch from edx-sphinx-theme to sphinx-book-theme
2 parents ea1a9d6 + d4794f4 commit 011634b

File tree

4 files changed

+66
-18
lines changed

4 files changed

+66
-18
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Change Log
1414
Unreleased
1515
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616

17+
* Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
18+
deprecated
19+
1720
[1.4.0] - 2022-05-23
1821
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1922

docs/conf.py

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
import os
1818
import re
1919
import sys
20+
from datetime import datetime
2021
from subprocess import check_call
2122

22-
import edx_theme
23+
2324

2425

2526
def get_version(*file_paths):
@@ -57,7 +58,6 @@ def get_version(*file_paths):
5758
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
5859
# ones.
5960
extensions = [
60-
'edx_theme',
6161
'sphinx.ext.autodoc',
6262
'sphinx.ext.doctest',
6363
'sphinx.ext.intersphinx',
@@ -88,8 +88,8 @@ def get_version(*file_paths):
8888

8989
# General information about the project.
9090
project = 'code-annotations'
91-
copyright = edx_theme.COPYRIGHT # pylint: disable=redefined-builtin
92-
author = edx_theme.AUTHOR
91+
copyright = f'{datetime.now().year}, Axim Collaborative, Inc' # pylint: disable=redefined-builtin
92+
author = 'Axim Collaborative, Inc'
9393
project_title = 'Code Annotations'
9494
documentation_title = f"{project_title}"
9595

@@ -160,16 +160,46 @@ def get_version(*file_paths):
160160
# The theme to use for HTML and HTML Help pages. See the documentation for
161161
# a list of builtin themes.
162162

163-
html_theme = 'edx_theme'
163+
html_theme = 'sphinx_book_theme'
164164

165165
# Theme options are theme-specific and customize the look and feel of a theme
166166
# further. For a list of options available for each theme, see the
167167
# documentation.
168168
#
169-
# html_theme_options = {}
169+
html_theme_options = {
170+
"repository_url": "https://github.com/openedx/code-annotations",
171+
"repository_branch": "master",
172+
"path_to_docs": "docs/",
173+
"home_page_in_toc": True,
174+
"use_repository_button": True,
175+
"use_issues_button": True,
176+
"use_edit_page_button": True,
177+
# Please don't change unless you know what you're doing.
178+
"extra_footer": """
179+
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
180+
<img
181+
alt="Creative Commons License"
182+
style="border-width:0"
183+
src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png"/>
184+
</a>
185+
<br>
186+
These works by
187+
<a
188+
xmlns:cc="https://creativecommons.org/ns#"
189+
href="https://openedx.org"
190+
property="cc:attributionName"
191+
rel="cc:attributionURL"
192+
>Axim Collaborative, Inc</a>
193+
are licensed under a
194+
<a
195+
rel="license"
196+
href="https://creativecommons.org/licenses/by-sa/4.0/"
197+
>Creative Commons Attribution-ShareAlike 4.0 International License</a>.
198+
"""
199+
}
170200

171201
# Add any paths that contain custom themes here, relative to this directory.
172-
html_theme_path = [edx_theme.get_html_theme_path()]
202+
# html_theme_path = []
173203

174204
# The name for this set of Sphinx documents.
175205
# "<project> v<release> documentation" by default.
@@ -183,13 +213,13 @@ def get_version(*file_paths):
183213
# The name of an image file (relative to this directory) to place at the top
184214
# of the sidebar.
185215
#
186-
# html_logo = None
216+
html_logo = "https://logos.openedx.org/open-edx-logo-color.png"
187217

188218
# The name of an image file (relative to this directory) to use as a favicon of
189219
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
190220
# pixels large.
191221
#
192-
# html_favicon = None
222+
html_favicon = "https://logos.openedx.org/open-edx-favicon.ico"
193223

194224
# Add any paths that contain custom static files (such as style sheets) here,
195225
# relative to this directory. They are copied after the builtin static files,

requirements/doc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
-r test.txt # Core and testing dependencies for this package
55

66
doc8 # reStructuredText style checker
7-
edx_sphinx_theme # edX theme for Sphinx output
7+
sphinx-book-theme # Common theme for all Open edX projects
88
Sphinx # Documentation builder
99
twine # Validates README.rst for usage on PyPI

requirements/doc.txt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#
55
# make upgrade
66
#
7+
accessible-pygments==0.0.4
8+
# via pydata-sphinx-theme
79
alabaster==0.7.12
810
# via sphinx
911
asgiref==3.5.2
@@ -15,7 +17,11 @@ attrs==21.4.0
1517
# -r requirements/test.txt
1618
# pytest
1719
babel==2.10.3
18-
# via sphinx
20+
# via
21+
# pydata-sphinx-theme
22+
# sphinx
23+
beautifulsoup4==4.12.2
24+
# via pydata-sphinx-theme
1925
bleach==5.0.1
2026
# via readme-renderer
2127
certifi==2022.6.15
@@ -43,11 +49,10 @@ doc8==0.11.2
4349
docutils==0.18.1
4450
# via
4551
# doc8
52+
# pydata-sphinx-theme
4653
# readme-renderer
4754
# restructuredtext-lint
4855
# sphinx
49-
edx-sphinx-theme==3.0.0
50-
# via -r requirements/doc.in
5156
idna==3.3
5257
# via requests
5358
imagesize==1.3.0
@@ -80,6 +85,7 @@ mock==4.0.3
8085
packaging==21.3
8186
# via
8287
# -r requirements/test.txt
88+
# pydata-sphinx-theme
8389
# pytest
8490
# sphinx
8591
pbr==5.9.0
@@ -98,9 +104,13 @@ py==1.11.0
98104
# pytest
99105
pycparser==2.21
100106
# via cffi
107+
pydata-sphinx-theme==0.13.3
108+
# via sphinx-book-theme
101109
pygments==2.12.0
102110
# via
111+
# accessible-pygments
103112
# doc8
113+
# pydata-sphinx-theme
104114
# readme-renderer
105115
# rich
106116
# sphinx
@@ -141,16 +151,19 @@ rich==12.4.4
141151
secretstorage==3.3.3
142152
# via keyring
143153
six==1.16.0
144-
# via
145-
# bleach
146-
# edx-sphinx-theme
154+
# via bleach
147155
snowballstemmer==2.2.0
148156
# via sphinx
157+
soupsieve==2.4.1
158+
# via beautifulsoup4
149159
sphinx==5.0.2
150160
# via
151161
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
152162
# -r requirements/doc.in
153-
# edx-sphinx-theme
163+
# pydata-sphinx-theme
164+
# sphinx-book-theme
165+
sphinx-book-theme==1.0.1
166+
# via -r requirements/doc.in
154167
sphinxcontrib-applehelp==1.0.2
155168
# via sphinx
156169
sphinxcontrib-devhelp==1.0.2
@@ -183,7 +196,9 @@ tomli==2.0.1
183196
twine==4.0.1
184197
# via -r requirements/doc.in
185198
typing-extensions==4.2.0
186-
# via rich
199+
# via
200+
# pydata-sphinx-theme
201+
# rich
187202
urllib3==1.26.9
188203
# via
189204
# requests

0 commit comments

Comments
 (0)