diff --git a/doc/_static/css/custom.css b/doc/_static/css/custom.css index d0b761e71d..8bcfdd3c7e 100644 --- a/doc/_static/css/custom.css +++ b/doc/_static/css/custom.css @@ -11,7 +11,7 @@ pre { img.platform-icon { height: 2ex; } -@media (prefers-color-scheme: dark) { +html[data-theme="dark"] { .wy-side-nav-search .wy-dropdown > a img.logo, .wy-side-nav-search > a img.logo { content: url("../logo-dark.svg"); diff --git a/doc/conf.py b/doc/conf.py index 51d463fd1f..c72e05bf8a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -44,7 +44,7 @@ # ones. # extensions = [ # 'recommonmark', -# "sphinx_rtd_theme", +# "sphinx_book_theme", # 'myst_parser', # 'sphinx_markdown_tables', # 'sphinx.ext.autosummary' @@ -53,7 +53,7 @@ extensions = [ "deepmodeling_sphinx", "dargs.sphinx", - "sphinx_rtd_theme", + "sphinx_book_theme", "myst_nb", "sphinx.ext.autosummary", "sphinx.ext.mathjax", @@ -70,6 +70,7 @@ "autoapi.extension", "sphinxcontrib.programoutput", "sphinxcontrib.moderncmakedomain", + "sphinx_remove_toctrees", ] # breathe_domain_by_extension = { @@ -175,9 +176,15 @@ # 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" +html_theme_options = { + "logo": { + "image_light": "_static/logo.svg", + "image_dark": "_static/logo-dark.svg", + } +} # 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, # so a file named "default.css" will overwrite the builtin "default.css". @@ -215,3 +222,5 @@ napoleon_numpy_docstring = False bibtex_bibfiles = ["../CITATIONS.bib"] + +remove_from_toctrees = ["autoapi/**/*", "API_CC/*", "api_c/*", "api_core/*"] diff --git a/pyproject.toml b/pyproject.toml index 6f0404174d..00f83fef06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ test = [ ] docs = [ "sphinx>=3.1.1", - "sphinx_rtd_theme>=1.0.0rc1", + "sphinx-book-theme", "myst-nb>=1.0.0rc0", "myst-parser>=0.19.2", "sphinx-design", @@ -97,7 +97,7 @@ docs = [ "exhale>=0.3.7", "numpydoc", "ase", - "deepmodeling-sphinx>=0.1.0", + "deepmodeling-sphinx>=0.3.0", "dargs>=0.3.4", "sphinx-argparse<0.5.0", "pygments-lammps", @@ -105,6 +105,7 @@ docs = [ "sphinx-autoapi>=3.0.0", "sphinxcontrib-programoutput", "sphinxcontrib-moderncmakedomain", + "sphinx-remove-toctrees", ] lmp = [ "lammps~=2024.8.29.1.0",