Skip to content

Commit 507d921

Browse files
committed
chore: Switch from edx-sphinx-theme to sphinx-book-theme
The edx-sphinx theme is being deprecated, and replaced with sphinx-book-theme. This removes references to the deprecated theme and replaces them with the new standard theme for the platform.
1 parent d16c548 commit 507d921

File tree

4 files changed

+114
-62
lines changed

4 files changed

+114
-62
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}, edX Inc.' # pylint: disable=redefined-builtin
92+
author = 'edX 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+
>The Center for Reimagining Learning</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: 71 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,97 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.8
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
44
#
5-
# make upgrade
5+
# pip-compile --output-file=requirements/doc.txt requirements/doc.in
66
#
7-
alabaster==0.7.12
7+
accessible-pygments==0.0.4
8+
# via pydata-sphinx-theme
9+
alabaster==0.7.13
810
# via sphinx
911
asgiref==3.5.2
10-
# via
11-
# -r requirements/test.txt
12-
# django
12+
# via -r requirements/test.txt
1313
attrs==21.4.0
1414
# via
1515
# -r requirements/test.txt
1616
# pytest
17-
babel==2.10.3
18-
# via sphinx
19-
bleach==5.0.1
17+
babel==2.12.1
18+
# via
19+
# pydata-sphinx-theme
20+
# sphinx
21+
beautifulsoup4==4.12.0
22+
# via pydata-sphinx-theme
23+
bleach==6.0.0
2024
# via readme-renderer
21-
certifi==2022.6.15
25+
certifi==2022.12.7
2226
# via requests
23-
charset-normalizer==2.0.12
27+
cffi==1.15.1
28+
# via cryptography
29+
charset-normalizer==3.1.0
2430
# via requests
2531
click==8.1.3
2632
# via -r requirements/test.txt
27-
commonmark==0.9.1
28-
# via rich
2933
coverage[toml]==6.4.1
3034
# via
3135
# -r requirements/test.txt
3236
# pytest-cov
33-
django==3.2.13
34-
# via
35-
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
36-
# -r requirements/test.txt
37-
doc8==0.11.2
37+
cryptography==40.0.1
38+
# via secretstorage
39+
doc8==1.1.1
3840
# via -r requirements/doc.in
39-
docutils==0.18.1
41+
docutils==0.19
4042
# via
4143
# doc8
44+
# pydata-sphinx-theme
4245
# readme-renderer
4346
# restructuredtext-lint
4447
# sphinx
45-
edx-sphinx-theme==3.0.0
46-
# via -r requirements/doc.in
47-
idna==3.3
48+
idna==3.4
4849
# via requests
49-
imagesize==1.3.0
50+
imagesize==1.4.1
5051
# via sphinx
51-
importlib-metadata==4.12.0
52+
importlib-metadata==6.1.0
5253
# via
5354
# keyring
54-
# sphinx
5555
# twine
5656
iniconfig==1.1.1
5757
# via
5858
# -r requirements/test.txt
5959
# pytest
60+
jaraco-classes==3.2.3
61+
# via keyring
62+
jeepney==0.8.0
63+
# via
64+
# keyring
65+
# secretstorage
6066
jinja2==3.1.2
6167
# via
6268
# -r requirements/test.txt
6369
# sphinx
64-
keyring==23.6.0
70+
keyring==23.13.1
6571
# via twine
72+
markdown-it-py==2.2.0
73+
# via rich
6674
markupsafe==2.1.1
6775
# via
6876
# -r requirements/test.txt
6977
# jinja2
78+
mdurl==0.1.2
79+
# via markdown-it-py
7080
mock==4.0.3
7181
# via -r requirements/test.txt
82+
more-itertools==9.1.0
83+
# via jaraco-classes
7284
packaging==21.3
7385
# via
7486
# -r requirements/test.txt
87+
# pydata-sphinx-theme
7588
# pytest
7689
# sphinx
7790
pbr==5.9.0
7891
# via
7992
# -r requirements/test.txt
8093
# stevedore
81-
pkginfo==1.8.3
94+
pkginfo==1.9.6
8295
# via twine
8396
pluggy==1.0.0
8497
# via
@@ -88,9 +101,15 @@ py==1.11.0
88101
# via
89102
# -r requirements/test.txt
90103
# pytest
91-
pygments==2.12.0
104+
pycparser==2.21
105+
# via cffi
106+
pydata-sphinx-theme==0.13.1
107+
# via sphinx-book-theme
108+
pygments==2.14.0
92109
# via
110+
# accessible-pygments
93111
# doc8
112+
# pydata-sphinx-theme
94113
# readme-renderer
95114
# rich
96115
# sphinx
@@ -107,42 +126,45 @@ pytest-cov==3.0.0
107126
python-slugify==6.1.2
108127
# via -r requirements/test.txt
109128
pytz==2022.1
110-
# via
111-
# -r requirements/test.txt
112-
# babel
113-
# django
129+
# via -r requirements/test.txt
114130
pyyaml==6.0
115131
# via -r requirements/test.txt
116-
readme-renderer==35.0
132+
readme-renderer==37.3
117133
# via twine
118-
requests==2.28.0
134+
requests==2.28.2
119135
# via
120136
# requests-toolbelt
121137
# sphinx
122138
# twine
123-
requests-toolbelt==0.9.1
139+
requests-toolbelt==0.10.1
124140
# via twine
125141
restructuredtext-lint==1.4.0
126142
# via doc8
127143
rfc3986==2.0.0
128144
# via twine
129-
rich==12.4.4
145+
rich==13.3.3
130146
# via twine
147+
secretstorage==3.3.3
148+
# via keyring
131149
six==1.16.0
132-
# via
133-
# bleach
134-
# edx-sphinx-theme
150+
# via bleach
135151
snowballstemmer==2.2.0
136152
# via sphinx
137-
sphinx==5.0.2
153+
soupsieve==2.4
154+
# via beautifulsoup4
155+
sphinx==5.3.0
138156
# via
157+
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
139158
# -r requirements/doc.in
140-
# edx-sphinx-theme
141-
sphinxcontrib-applehelp==1.0.2
159+
# pydata-sphinx-theme
160+
# sphinx-book-theme
161+
sphinx-book-theme==1.0.0
162+
# via -r requirements/doc.in
163+
sphinxcontrib-applehelp==1.0.4
142164
# via sphinx
143165
sphinxcontrib-devhelp==1.0.2
144166
# via sphinx
145-
sphinxcontrib-htmlhelp==2.0.0
167+
sphinxcontrib-htmlhelp==2.0.1
146168
# via sphinx
147169
sphinxcontrib-jsmath==1.0.1
148170
# via sphinx
@@ -151,9 +173,7 @@ sphinxcontrib-qthelp==1.0.3
151173
sphinxcontrib-serializinghtml==1.1.5
152174
# via sphinx
153175
sqlparse==0.4.2
154-
# via
155-
# -r requirements/test.txt
156-
# django
176+
# via -r requirements/test.txt
157177
stevedore==3.5.0
158178
# via
159179
# -r requirements/test.txt
@@ -166,16 +186,15 @@ tomli==2.0.1
166186
# via
167187
# -r requirements/test.txt
168188
# coverage
189+
# doc8
169190
# pytest
170-
twine==4.0.1
191+
twine==4.0.2
171192
# via -r requirements/doc.in
172-
typing-extensions==4.2.0
173-
# via rich
174-
urllib3==1.26.9
193+
urllib3==1.26.15
175194
# via
176195
# requests
177196
# twine
178197
webencodings==0.5.1
179198
# via bleach
180-
zipp==3.8.0
199+
zipp==3.15.0
181200
# via importlib-metadata

0 commit comments

Comments
 (0)