Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: replace sphinx-rtd-theme with sphinx-book-theme #78

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# ones.
extensions = [
"deepmodeling_sphinx",
"sphinx_rtd_theme",
"sphinx_book_theme",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Remove sphinx-rtd-theme from requirements.txt

The theme configuration has been properly updated to use sphinx_book_theme, but the old theme package is still listed as a dependency in docs/requirements.txt. Please remove the sphinx_rtd_theme line from the requirements file.

  • docs/requirements.txt: Remove the line containing sphinx_rtd_theme
🔗 Analysis chain

Verify complete removal of sphinx-rtd-theme.

The addition of sphinx_book_theme to the extensions list is correct. However, let's ensure that all references to the old theme have been removed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to sphinx-rtd-theme
# Expected: No occurrences of sphinx-rtd-theme in the codebase

echo "Checking for remaining references to sphinx-rtd-theme..."
rg -i "sphinx.?rtd.?theme"

echo "Checking requirements files for sphinx-rtd-theme package..."
fd requirements.txt --exec grep -i "sphinx.?rtd.?theme" {}

Length of output: 382


Script:

#!/bin/bash
# Let's check the complete content of docs/conf.py to see all theme-related configurations
echo "Checking docs/conf.py content..."
cat docs/conf.py

# Also check if sphinx-rtd-theme is still being used in the HTML theme configuration
echo -e "\nChecking for html_theme configuration..."
rg "html_theme.*=.*" docs/conf.py

Length of output: 5998

"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"numpydoc",
Expand Down Expand Up @@ -85,7 +85,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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider configuring theme options for better documentation experience.

While the theme change is correct, sphinx-book-theme offers several useful configuration options that could enhance your documentation. Consider adding theme options like:

 html_theme = "sphinx_book_theme"
+
+# Theme options
+html_theme_options = {
+    "repository_url": "https://github.com/deepmodeling/dargs",
+    "use_repository_button": True,
+    "use_issues_button": True,
+    "use_edit_page_button": True,
+    "navigation_with_keys": True,
+}

These options would add:

  • Repository links
  • Issue reporting button
  • Edit page button
  • Keyboard navigation

Committable suggestion was skipped due to low confidence.


# 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
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.
numpydoc
deepmodeling_sphinx>=0.1.1
deepmodeling-sphinx>=0.3.0
myst-nb
sphinx_rtd_theme
sphinx-book-theme
sphinx-argparse<0.5.0