Skip to content

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

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

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

njzjz-bot
Copy link
Contributor

@njzjz-bot njzjz-bot commented Oct 28, 2024

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

    • 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.

Compared to `sphinx-rtd-theme`, `sphinx-book-theme` is a clean and modern Sphinx theme.

Generated by the task: njzjz-bot/njzjz-bot#11.
Copy link
Contributor

coderabbitai bot commented Oct 28, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request includes modifications to the Sphinx documentation configuration file doc/conf.py and the requirements.txt file. The primary change in conf.py is the replacement of the theme from sphinx_rtd_theme to sphinx_book_theme, along with the introduction of html_theme_options for logo images. In requirements.txt, the dependency sphinx_rtd_theme is replaced with sphinx-book-theme, and the version of deepmodeling_sphinx is updated. These changes focus on updating the documentation theme and its associated dependencies.

Changes

File Change Summary
doc/conf.py - Updated extensions to include sphinx_book_theme instead of sphinx_rtd_theme.
- Changed html_theme to sphinx_book_theme.
- Added html_theme_options for light and dark logos.
doc/requirements.txt - Replaced sphinx_rtd_theme with sphinx-book-theme.
- Updated deepmodeling_sphinx version from >=0.1.1 to >=0.3.0.

Possibly related PRs


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

njzjz and others added 2 commits October 28, 2024 03:23
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.53%. Comparing base (8629433) to head (db11609).
Report is 19 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #1657   +/-   ##
=======================================
  Coverage   49.53%   49.53%           
=======================================
  Files          83       83           
  Lines       14849    14849           
=======================================
  Hits         7356     7356           
  Misses       7493     7493           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
doc/requirements.txt (2)

4-4: Add version constraint for sphinx-book-theme.

To prevent potential compatibility issues from future breaking changes, consider adding a version constraint.

-sphinx-book-theme
+sphinx-book-theme>=0.4.0

11-11: Remove trailing dot.

There appears to be an unnecessary trailing dot at the end of the file.

-dargs>=0.3.1
-numpydoc
-.
+dargs>=0.3.1
+numpydoc
doc/conf.py (2)

33-33: Remove redundant commented extension configuration.

The theme extension sphinx_book_theme appears in both the commented-out extensions list and the active extensions list. Consider removing the commented block (lines 32-37) as it appears to be obsolete.

Also applies to: 42-42


74-87: Consider documenting visual changes for users.

The migration from sphinx-rtd-theme to sphinx-book-theme may introduce visual changes in the documentation layout and navigation. Consider:

  1. Adding a note in the changelog about this visual refresh
  2. Testing the documentation build to ensure all existing content renders correctly
  3. Verifying mobile responsiveness of the new theme
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f303aa8 and 3391ea1.

📒 Files selected for processing (2)
  • doc/conf.py (3 hunks)
  • doc/requirements.txt (1 hunks)
🔇 Additional comments (3)
doc/requirements.txt (1)

8-8: Verify compatibility with the new version of deepmodeling-sphinx.

The major version bump from 0.1.1 to 0.3.0 might introduce breaking changes.

✅ Verification successful

Let me gather more information about the configuration and usage to better assess compatibility.


Let me check for any recent changes or issues in the documentation setup.


Based on the git history, I can now provide a final response:

The version upgrade from 0.1.1 to 0.3.0 appears to be part of a coordinated documentation update

The git history shows that this change was made alongside a theme switch from sphinx_rtd_theme to sphinx_book_theme, suggesting it was part of a planned documentation system upgrade. The deepmodeling_sphinx extension is used in a straightforward way in conf.py without any custom configurations that might be affected by breaking changes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if there are any known compatibility issues or breaking changes
# between deepmodeling-sphinx>=0.3.0 and sphinx-book-theme

# Search for any documentation about version compatibility
rg -i "deepmodeling.*sphinx.*0\.3\.0|sphinx.*book.*theme" README.md docs/ 2>/dev/null

# Check if there are any existing configurations that might need updates
rg "deepmodeling.*sphinx" doc/conf.py 2>/dev/null

Length of output: 142


Script:

#!/bin/bash
# Check the current configuration in conf.py
cat doc/conf.py

# Look for any extension configurations or theme settings
rg -A 5 "extensions\s*=" doc/conf.py

# Check for any custom directives or features being used
rg -l "directive|role" doc/

Length of output: 4419


Script:

#!/bin/bash
# Check recent changes to documentation configuration
git log -p -- doc/conf.py doc/requirements.txt | grep -A 5 "deepmodeling.*sphinx"

# Check if there are any documentation build files that might show compatibility issues
fd -e rst -e md . doc/ -x grep -l "deepmodeling" {} \;

# Look for any custom extensions or configurations
rg "deepmodeling_sphinx\." doc/

Length of output: 1981

doc/conf.py (2)

74-75: LGTM! Theme configuration is properly set.

The theme configuration aligns with the PR objectives to replace sphinx-rtd-theme with sphinx-book-theme.


82-87: Verify the existence of logo files.

The theme options configuration is well-structured with both light and dark mode logos. However, let's ensure both logo files exist in the correct location.

✅ Verification successful

Logo files verification successful

Both logo files (logo.svg and logo-dark.svg) exist in the correct doc/_static/ directory, confirming that the theme configuration will work as expected.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of both logo files
# Expected: Both files should exist in the _static directory

echo "Checking for logo files..."
for logo in "doc/_static/logo.svg" "doc/_static/logo-dark.svg"; do
  if [ -f "$logo" ]; then
    echo "✓ Found: $logo"
  else
    echo "✗ Missing: $logo"
  fi
done

Length of output: 413

@wanghan-iapcm wanghan-iapcm merged commit 0f7e15c into deepmodeling:devel Nov 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants