From 75c9c27875773ea22416c0a9340b818680976804 Mon Sep 17 00:00:00 2001 From: Kshitij Sobti Date: Fri, 26 May 2023 01:42:17 +0530 Subject: [PATCH] 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. See openedx/edx-sphinx-theme#184 --- docs/conf.py | 50 +++++++++++++++++++++++++++++++++---------- requirements/docs.in | 2 +- requirements/docs.txt | 33 +++++++++++++++++++++------- 3 files changed, 65 insertions(+), 20 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index b677f988e..f4d4112ff 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import edx_theme +from datetime import datetime # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -23,9 +23,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 = [ - "edx_theme", -] +extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -41,8 +39,8 @@ # General information about the project. project = "edX Credentials" -author = edx_theme.AUTHOR -copyright = edx_theme.COPYRIGHT +copyright = f"{datetime.now().year}, Axim Collaborative, Inc" # pylint: disable=redefined-builtin +author = "Axim Collaborative, 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 @@ -92,15 +90,45 @@ # 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/credentials", + "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": """ + + Creative Commons License + +
+ These works by + Axim Collaborative, Inc + are licensed under a + Creative Commons Attribution-ShareAlike 4.0 International License. + """, +} # 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. If None, it defaults to # " v documentation". @@ -111,12 +139,12 @@ # 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 (within the static path) to use as 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, diff --git a/requirements/docs.in b/requirements/docs.in index 9dc8cf776..2e512f92c 100644 --- a/requirements/docs.in +++ b/requirements/docs.in @@ -9,6 +9,6 @@ -c constraints.txt -edx-sphinx-theme +sphinx-book-theme Sphinx jsx-lexer # A JSX lexer for Pygments diff --git a/requirements/docs.txt b/requirements/docs.txt index 1ac0f5d53..869f3ff87 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -4,18 +4,24 @@ # # make upgrade # +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.2 + # via pydata-sphinx-theme certifi==2023.5.7 # via requests charset-normalizer==3.1.0 # via requests docutils==0.19 - # via sphinx -edx-sphinx-theme==3.1.0 - # via -r requirements/docs.in + # via + # pydata-sphinx-theme + # sphinx idna==3.4 # via requests imagesize==1.4.1 @@ -29,25 +35,34 @@ jsx-lexer==2.0.1 markupsafe==2.1.2 # via jinja2 packaging==23.1 - # via sphinx + # via + # pydata-sphinx-theme + # sphinx +pydata-sphinx-theme==0.13.3 + # via sphinx-book-theme pygments==2.15.1 # via + # accessible-pygments # jsx-lexer + # pydata-sphinx-theme # sphinx pytz==2023.3 # via babel requests==2.31.0 # via sphinx -six==1.16.0 - # via edx-sphinx-theme snowballstemmer==2.2.0 # via sphinx +soupsieve==2.4.1 + # via beautifulsoup4 sphinx==5.3.0 # via # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/docs.in - # edx-sphinx-theme + # pydata-sphinx-theme + # sphinx-book-theme +sphinx-book-theme==1.0.1 + # via -r requirements/docs.in sphinxcontrib-applehelp==1.0.4 # via sphinx sphinxcontrib-devhelp==1.0.2 @@ -60,6 +75,8 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx +typing-extensions==4.6.2 + # via pydata-sphinx-theme urllib3==1.26.16 # via # -c requirements/constraints.txt