Skip to content

Commit abd1c9c

Browse files
njzjz-botnjzjzpre-commit-ci[bot]
authored
docs: replace sphinx-rtd-theme with sphinx-book-theme (#4266)
Compared to `sphinx-rtd-theme`, `sphinx-book-theme` is a clean and modern Sphinx theme. Generated by the task: njzjz-bot/njzjz-bot#11. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated documentation theme to enhance visual presentation with the new "sphinx_book_theme." - Introduced a new extension to manage table of contents visibility. - Enhanced dark mode styles for improved user experience. - **Bug Fixes** - Improved compatibility with documentation tools by updating dependencies in the project configuration. - Updated version constraints for documentation-related dependencies. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 95f0ed5 commit abd1c9c

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

doc/_static/css/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pre {
1111
img.platform-icon {
1212
height: 2ex;
1313
}
14-
@media (prefers-color-scheme: dark) {
14+
html[data-theme="dark"] {
1515
.wy-side-nav-search .wy-dropdown > a img.logo,
1616
.wy-side-nav-search > a img.logo {
1717
content: url("../logo-dark.svg");

doc/conf.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# ones.
4545
# extensions = [
4646
# 'recommonmark',
47-
# "sphinx_rtd_theme",
47+
# "sphinx_book_theme",
4848
# 'myst_parser',
4949
# 'sphinx_markdown_tables',
5050
# 'sphinx.ext.autosummary'
@@ -53,7 +53,7 @@
5353
extensions = [
5454
"deepmodeling_sphinx",
5555
"dargs.sphinx",
56-
"sphinx_rtd_theme",
56+
"sphinx_book_theme",
5757
"myst_nb",
5858
"sphinx.ext.autosummary",
5959
"sphinx.ext.mathjax",
@@ -70,6 +70,7 @@
7070
"autoapi.extension",
7171
"sphinxcontrib.programoutput",
7272
"sphinxcontrib.moderncmakedomain",
73+
"sphinx_remove_toctrees",
7374
]
7475

7576
# breathe_domain_by_extension = {
@@ -175,9 +176,15 @@
175176
# The theme to use for HTML and HTML Help pages. See the documentation for
176177
# a list of builtin themes.
177178
#
178-
html_theme = "sphinx_rtd_theme"
179+
html_theme = "sphinx_book_theme"
179180
html_logo = "_static/logo.svg"
180181

182+
html_theme_options = {
183+
"logo": {
184+
"image_light": "_static/logo.svg",
185+
"image_dark": "_static/logo-dark.svg",
186+
}
187+
}
181188
# Add any paths that contain custom static files (such as style sheets) here,
182189
# relative to this directory. They are copied after the builtin static files,
183190
# so a file named "default.css" will overwrite the builtin "default.css".
@@ -215,3 +222,5 @@
215222
napoleon_numpy_docstring = False
216223

217224
bibtex_bibfiles = ["../CITATIONS.bib"]
225+
226+
remove_from_toctrees = ["autoapi/**/*", "API_CC/*", "api_c/*", "api_core/*"]

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,23 @@ test = [
8989
]
9090
docs = [
9191
"sphinx>=3.1.1",
92-
"sphinx_rtd_theme>=1.0.0rc1",
92+
"sphinx-book-theme",
9393
"myst-nb>=1.0.0rc0",
9494
"myst-parser>=0.19.2",
9595
"sphinx-design",
9696
"breathe",
9797
"exhale>=0.3.7",
9898
"numpydoc",
9999
"ase",
100-
"deepmodeling-sphinx>=0.1.0",
100+
"deepmodeling-sphinx>=0.3.0",
101101
"dargs>=0.3.4",
102102
"sphinx-argparse<0.5.0",
103103
"pygments-lammps",
104104
"sphinxcontrib-bibtex",
105105
"sphinx-autoapi>=3.0.0",
106106
"sphinxcontrib-programoutput",
107107
"sphinxcontrib-moderncmakedomain",
108+
"sphinx-remove-toctrees",
108109
]
109110
lmp = [
110111
"lammps~=2024.8.29.1.0",

0 commit comments

Comments
 (0)