Skip to content

Commit

Permalink
chore: Switch from edx-sphinx-theme to sphinx-book-theme
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xitij2000 committed Apr 6, 2023
1 parent c84b35d commit 61c07a2
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 17 deletions.
47 changes: 38 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import os
import re
import sys
from datetime import datetime
from subprocess import check_call

from django import setup as django_setup
from django.conf import settings

import edx_theme


def get_version(*file_paths):
Expand Down Expand Up @@ -63,7 +63,6 @@ def get_version(*file_paths):
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'edx_theme',
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
Expand Down Expand Up @@ -94,8 +93,8 @@ def get_version(*file_paths):

# General information about the project.
project = 'edx-when'
copyright = edx_theme.COPYRIGHT # pylint: disable=redefined-builtin
author = edx_theme.AUTHOR
copyright = f'{datetime.now().year}, edX Inc.' # pylint: disable=redefined-builtin
author = 'edX Inc.'
project_title = 'Schedule'
documentation_title = f"{project_title}"

Expand Down Expand Up @@ -166,16 +165,46 @@ def get_version(*file_paths):
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'edx_theme'
html_theme = 'sphinx_book_theme'

# 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
# documentation.
#
# html_theme_options = {}
html_theme_options = {
"repository_url": "https://github.com/openedx/edx-when",
"repository_branch": "master",
"path_to_docs": "docs/",
"home_page_in_toc": True,
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
# Please don't change unless you know what you're doing.
"extra_footer": """
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
<img
alt="Creative Commons License"
style="border-width:0"
src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png"/>
</a>
<br>
These works by
<a
xmlns:cc="https://creativecommons.org/ns#"
href="https://openedx.org"
property="cc:attributionName"
rel="cc:attributionURL"
>The Center for Reimagining Learning</a>
are licensed under a
<a
rel="license"
href="https://creativecommons.org/licenses/by-sa/4.0/"
>Creative Commons Attribution-ShareAlike 4.0 International License</a>.
"""
}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [edx_theme.get_html_theme_path()]
# html_theme_path = []

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
Expand All @@ -189,13 +218,13 @@ def get_version(*file_paths):
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#
# html_logo = None
html_logo = "https://logos.openedx.org/open-edx-logo-color.png"

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

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
2 changes: 1 addition & 1 deletion requirements/doc.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
-r test.txt # Core and testing dependencies for this package

doc8 # reStructuredText style checker
edx_sphinx_theme # edX theme for Sphinx output
sphinx-book-theme # Common theme for all Open edX projects
sphinx # Documentation builder
twine # Validates README.rst for usage on PyPI
28 changes: 22 additions & 6 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# make upgrade
#
accessible-pygments==0.0.4
# via pydata-sphinx-theme
alabaster==0.7.13
# via sphinx
appdirs==1.4.4
Expand All @@ -19,7 +21,11 @@ attrs==22.2.0
# -r requirements/test.txt
# pytest
babel==2.12.1
# via sphinx
# via
# pydata-sphinx-theme
# sphinx
beautifulsoup4==4.12.0
# via pydata-sphinx-theme
bleach==6.0.0
# via readme-renderer
certifi==2022.12.7
Expand Down Expand Up @@ -84,6 +90,7 @@ doc8==1.1.1
docutils==0.19
# via
# doc8
# pydata-sphinx-theme
# readme-renderer
# restructuredtext-lint
# sphinx
Expand All @@ -101,8 +108,6 @@ edx-opaque-keys==2.3.0
# via
# -r requirements/test.txt
# edx-drf-extensions
edx-sphinx-theme==3.1.0
# via -r requirements/doc.in
exceptiongroup==1.1.1
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -169,6 +174,7 @@ newrelic==8.7.0
packaging==23.0
# via
# -r requirements/test.txt
# pydata-sphinx-theme
# pytest
# sphinx
pbr==5.11.1
Expand All @@ -193,9 +199,13 @@ pycryptodomex==3.17
# via
# -r requirements/test.txt
# pyjwkest
pydata-sphinx-theme==0.13.3
# via sphinx-book-theme
pygments==2.14.0
# via
# accessible-pygments
# doc8
# pydata-sphinx-theme
# readme-renderer
# rich
# sphinx
Expand Down Expand Up @@ -275,17 +285,21 @@ six==1.16.0
# -r requirements/test.txt
# bleach
# edx-drf-extensions
# edx-sphinx-theme
# fs
# pyjwkest
# python-dateutil
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4
# via beautifulsoup4
sphinx==5.3.0
# via
# -c requirements/common_constraints.txt
# -r requirements/doc.in
# edx-sphinx-theme
# pydata-sphinx-theme
# sphinx-book-theme
sphinx-book-theme==1.0.1
# via -r requirements/doc.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
Expand Down Expand Up @@ -322,7 +336,9 @@ tomli==2.0.1
twine==4.0.2
# via -r requirements/doc.in
typing-extensions==4.5.0
# via rich
# via
# pydata-sphinx-theme
# rich
urllib3==1.26.15
# via
# -r requirements/test.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ wheel==0.40.0
# The following packages are considered to be unsafe in a requirements file:
pip==23.0.1
# via -r requirements/pip.in
setuptools==67.6.0
setuptools==67.6.1
# via -r requirements/pip.in

0 comments on commit 61c07a2

Please sign in to comment.