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 #4266

Merged
merged 7 commits into from
Oct 29, 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 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.

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 updates to the Sphinx documentation configuration in doc/conf.py and modifications to dependency management in pyproject.toml. The changes in doc/conf.py involve switching the Sphinx theme from "sphinx_rtd_theme" to "sphinx_book_theme" in both the extensions list and the html_theme variable. In pyproject.toml, the sphinx_rtd_theme dependency is replaced with sphinx-book-theme, and the version constraint for deepmodeling-sphinx is increased.

Changes

File Change Summary
doc/conf.py - Updated html_theme from "sphinx_rtd_theme" to "sphinx_book_theme".
- Removed "sphinx_rtd_theme" from extensions.
- Added "sphinx_book_theme" to extensions.
- Added "sphinx_remove_toctrees" to extensions.
- Introduced remove_from_toctrees variable with specified paths.
pyproject.toml - Updated dependency from "sphinx_rtd_theme>=1.0.0rc1" to "sphinx-book-theme".
- Updated dependency version from "deepmodeling-sphinx>=0.1.0" to "deepmodeling-sphinx>=0.3.0".

Possibly related PRs

Suggested reviewers

  • wanghan-iapcm

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2e9b842 and b3a843d.

📒 Files selected for processing (1)
  • doc/conf.py (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • doc/conf.py

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.

@github-actions github-actions bot added the Docs label Oct 28, 2024
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 (1)
doc/conf.py (1)

Line range hint 46-52: Remove commented out extensions block.

This commented block contains duplicate configuration that could become outdated and confusing. Consider removing it since the active extensions are properly configured below.

-# extensions = [
-#     'recommonmark',
-#     "sphinx_book_theme",
-#     'myst_parser',
-#     'sphinx_markdown_tables',
-#     'sphinx.ext.autosummary'
-# ]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 13e247e and d38010c.

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

56-56: LGTM: Theme configuration looks correct.

The changes properly configure the new sphinx-book-theme by:

  1. Adding it to the extensions list
  2. Setting it as the html_theme

The configuration follows Sphinx conventions where package names use hyphens (sphinx-book-theme) and Python module names use underscores (sphinx_book_theme).

Also applies to: 178-178

pyproject.toml (1)

100-100: Verify compatibility with major version update.

The deepmodeling-sphinx dependency has been updated from >=0.1.0 to >=0.3.0. Since this is a major version bump in a pre-1.0 package, it might contain breaking changes.

Let's check the changelog and dependencies:

pyproject.toml Show resolved Hide resolved
@njzjz njzjz marked this pull request as draft October 28, 2024 06:27
njzjz added 2 commits October 28, 2024 02:44
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
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: 0

🧹 Outside diff range and nitpick comments (1)
doc/_static/css/custom.css (1)

Line range hint 6-9: Consider making the logo width responsive.

The fixed width of 275px might not adapt well to smaller screens. Consider using relative units or adding a max-width constraint.

 .wy-side-nav-search .wy-dropdown > a img.logo,
 .wy-side-nav-search > a img.logo {
-  width: 275px;
+  width: min(275px, 100%);
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between cd4b3b1 and 2e9b842.

📒 Files selected for processing (1)
  • doc/_static/css/custom.css (1 hunks)
🔇 Additional comments (1)
doc/_static/css/custom.css (1)

Line range hint 14-21: LGTM! Theme detection improvement.

The switch from media queries to data-theme attributes is a good improvement as it:

  • Allows manual theme switching independent of system preferences
  • Aligns with the new sphinx-book-theme implementation

Let's verify the dark logo exists:

✅ Verification successful

Dark mode logo path verified successfully

The dark mode logo file exists at the expected path relative to the CSS file location, confirming that the content URL reference in the CSS will work correctly.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the dark logo file exists
# Expected: Find the dark logo file referenced in the CSS

# Test: Check if the dark logo exists relative to the CSS file location
fd --base-directory doc "_static" --type f --exec test -f "doc/_static/logo-dark.svg" && echo "✓ Dark logo exists" || echo "✗ Dark logo missing"

Length of output: 130

njzjz and others added 2 commits October 28, 2024 03:24
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz marked this pull request as ready for review October 28, 2024 07:45
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.35%. Comparing base (13e247e) to head (b3a843d).
Report is 7 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #4266      +/-   ##
==========================================
+ Coverage   84.34%   84.35%   +0.01%     
==========================================
  Files         549      549              
  Lines       51463    51463              
  Branches     3051     3051              
==========================================
+ Hits        43404    43410       +6     
+ Misses       7097     7095       -2     
+ Partials      962      958       -4     

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

@njzjz njzjz requested a review from wanghan-iapcm October 28, 2024 19:38
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Oct 29, 2024
Merged via the queue into deepmodeling:devel with commit abd1c9c Oct 29, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants