-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #78 +/- ##
=======================================
Coverage 78.49% 78.49%
=======================================
Files 9 9
Lines 758 758
=======================================
Hits 595 595
Misses 163 163 ☔ View full report in Codecov by Sentry. |
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request involve updates to the Sphinx documentation configuration and requirements files. The Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
docs/requirements.txt (1)
Line range hint
1-7
: Remove unused theme and add missing dependencies.Since we're switching to sphinx-book-theme:
sphinx_rtd_theme
should be removed as it's no longer neededsphinx-book-theme
needs to be added as a dependencyApply this diff:
. numpydoc deepmodeling-sphinx>=0.3.0 myst-nb -sphinx_rtd_theme +sphinx-book-theme sphinx-argparse<0.5.0
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- docs/conf.py (2 hunks)
- docs/requirements.txt (1 hunks)
🔇 Additional comments (2)
docs/requirements.txt (2)
3-3
: LGTM: Package version update looks correct.The update to
deepmodeling-sphinx>=0.3.0
aligns with the package naming conventions (using hyphens instead of underscores).
Line range hint
1-7
: Verify sphinx-book-theme compatibility.Let's verify if there are any version constraints needed for sphinx-book-theme with the current dependencies.
✅ Verification successful
Let me gather more information about the dependencies and their compatibility.
No version constraints needed for sphinx-book-theme
The verification shows that sphinx-book-theme is used as a theme and extension in the project, but there are no specific version constraints required. The current setup shows compatibility with other extensions including deepmodeling-sphinx>=0.3.0, sphinx-argparse<0.5.0, and core Sphinx extensions without any conflicts.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if there are any specific version requirements for sphinx-book-theme # in the documentation or package metadata # Look for any mentions of sphinx-book-theme version requirements rg -i "sphinx.?book.?theme.*version|version.*sphinx.?book.?theme" # Check setup.py/pyproject.toml for any dependency specifications fd -e toml -e py -x cat {} | rg -i "sphinx.?book.?theme"Length of output: 186
Script:
#!/bin/bash # Check sphinx configuration and requirements fd "conf.py|requirements.txt" -x cat {} # Check if sphinx-book-theme is used with specific extensions rg -A 5 -B 5 "extensions = \[" # Look for any sphinx version constraints rg -i "sphinx.*=.*"Length of output: 7397
@@ -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" |
There was a problem hiding this comment.
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.
@@ -43,7 +43,7 @@ | |||
# ones. | |||
extensions = [ | |||
"deepmodeling_sphinx", | |||
"sphinx_rtd_theme", | |||
"sphinx_book_theme", |
There was a problem hiding this comment.
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 containingsphinx_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
Compared to `sphinx-rtd-theme`, `sphinx-book-theme` is a clean and modern Sphinx theme. Generated by the task: njzjz-bot/njzjz-bot#11.
18baa74
to
b8b398d
Compare
Compared to
sphinx-rtd-theme
,sphinx-book-theme
is a clean and modern Sphinx theme.Generated by the task: njzjz-bot/njzjz-bot#11.
Summary by CodeRabbit
New Features
Chores
deepmodeling_sphinx
package to a newer version for enhanced functionality.sphinx_rtd_theme
withsphinx-book-theme
in the documentation requirements.