From 0f7e15c99d05c4bb83db7797956d611cbc1dc689 Mon Sep 17 00:00:00 2001 From: "A bot of @njzjz" <48687836+njzjz-bot@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:52:13 -0500 Subject: [PATCH] docs: replace sphinx-rtd-theme with sphinx-book-theme (#1657) Compared to `sphinx-rtd-theme`, `sphinx-book-theme` is a clean and modern Sphinx theme. Generated by the task: https://github.com/njzjz-bot/njzjz-bot/issues/11. ## Summary by CodeRabbit - **New Features** - Updated documentation theme to `sphinx_book_theme`, enhancing visual presentation. - Introduced options for light and dark logo images in the documentation. - **Bug Fixes** - Updated dependency versions to ensure compatibility and improved functionality. - **Documentation** - Enhanced configuration settings for better theme management in the documentation. --------- Signed-off-by: Jinzhe Zeng Co-authored-by: Jinzhe Zeng Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- doc/conf.py | 12 +++++++++--- doc/requirements.txt | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index b0bcbb400..54e0f6389 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -30,7 +30,7 @@ # ones. # extensions = [ # 'recommonmark', -# "sphinx_rtd_theme", +# "sphinx_book_theme", # 'myst_parser', # 'sphinx_markdown_tables', # 'sphinx.ext.autosummary' @@ -39,7 +39,7 @@ extensions = [ "deepmodeling_sphinx", "dargs.sphinx", - "sphinx_rtd_theme", + "sphinx_book_theme", "myst_parser", "sphinx.ext.autosummary", "sphinx.ext.viewcode", @@ -71,7 +71,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "sphinx_rtd_theme" +html_theme = "sphinx_book_theme" html_logo = "_static/logo.svg" # Add any paths that contain custom static files (such as style sheets) here, @@ -79,6 +79,12 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_css_files = ["css/custom.css"] +html_theme_options = { + "logo": { + "image_light": "_static/logo.svg", + "image_dark": "_static/logo-dark.svg", + } +} autodoc_default_flags = ["members"] autosummary_generate = True diff --git a/doc/requirements.txt b/doc/requirements.txt index 9b49bb272..dcb203c17 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,11 +1,11 @@ # https://github.com/sphinx-doc/sphinx/issues/11662 sphinx>=4.0.2,!=7.2.5 recommonmark -sphinx_rtd_theme>=0.6 +sphinx-book-theme sphinx_markdown_tables sphinx-argparse<0.5.0 myst-parser -deepmodeling_sphinx>=0.1.1 +deepmodeling-sphinx>=0.3.0 dargs>=0.3.1 numpydoc .