Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

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 5, 2023
1 parent bb1cbe4 commit 2e9aa0e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 19 deletions.
47 changes: 40 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import sys
import edx_theme
from datetime import datetime


# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -12,7 +12,7 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'edx_theme']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -32,8 +32,8 @@

# General information about the project.
project = 'bok-choy'
copyright = edx_theme.COPYRIGHT
author = edx_theme.AUTHOR
copyright = f'{datetime.now().year}, edX Inc.' # pylint: disable=redefined-builtin
author = 'edX Inc.'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -56,13 +56,46 @@

# 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_path = [edx_theme.get_html_theme_path()]
html_favicon = os.path.join(html_theme_path[0], 'edx_theme', 'static', 'css', 'favicon.ico')
html_theme = 'sphinx_book_theme'
# html_theme_path = []
html_logo = "https://logos.openedx.org/open-edx-logo-color.png"
html_favicon = "https://logos.openedx.org/open-edx-favicon.ico"

# Output file base name for HTML help builder.
htmlhelp_basename = 'bok-choydoc'

html_theme_options = {
"repository_url": "https://github.com/openedx/bok-choy",
"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>.
"""
}


# -- Options for LaTeX output --------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion requirements/doc.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

-r base.txt # Core bok-choy dependencies

edx-sphinx-theme # edX theme for Sphinx output
sphinx-book-theme # Common theme for all Open edX projects
readme_renderer # Validates README.rst for usage on PyPI
sphinx # Documentation builder
36 changes: 25 additions & 11 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
# pip-compile --output-file=requirements/doc.txt requirements/doc.in
#
accessible-pygments==0.0.4
# via pydata-sphinx-theme
alabaster==0.7.13
# via sphinx
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 All @@ -16,15 +22,14 @@ charset-normalizer==3.1.0
# via requests
docutils==0.19
# via
# pydata-sphinx-theme
# readme-renderer
# sphinx
edx-sphinx-theme==3.1.0
# via -r requirements/doc.in
idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==6.0.0
importlib-metadata==6.1.0
# via sphinx
jinja2==3.1.2
# via sphinx
Expand All @@ -33,12 +38,18 @@ lazy==1.5
markupsafe==2.1.2
# via jinja2
packaging==23.0
# via sphinx
# via
# pydata-sphinx-theme
# sphinx
pydata-sphinx-theme==0.13.1
# via sphinx-book-theme
pygments==2.14.0
# via
# accessible-pygments
# pydata-sphinx-theme
# readme-renderer
# sphinx
pytz==2022.7.1
pytz==2023.2
# via babel
readme-renderer==37.3
# via -r requirements/doc.in
Expand All @@ -47,16 +58,19 @@ requests==2.28.2
selenium==3.141.0
# via -r requirements/base.txt
six==1.16.0
# via
# bleach
# edx-sphinx-theme
# via bleach
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4
# via beautifulsoup4
sphinx==5.3.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/doc.in
# edx-sphinx-theme
# pydata-sphinx-theme
# sphinx-book-theme
sphinx-book-theme==1.0.0
# via -r requirements/doc.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
Expand Down

0 comments on commit 2e9aa0e

Please sign in to comment.