Skip to content

docs: activate gurubase AI#3517

Merged
johanneskoester merged 2 commits intomainfrom
docs/gurubase
Apr 7, 2025
Merged

docs: activate gurubase AI#3517
johanneskoester merged 2 commits intomainfrom
docs/gurubase

Conversation

@johanneskoester
Copy link
Copy Markdown
Contributor

@johanneskoester johanneskoester commented Apr 7, 2025

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).

Summary by CodeRabbit

  • New Features
    • Introduced a new JavaScript file for the GuruBase widget that enhances webpage functionality upon loading.
  • Documentation
    • Updated documentation configuration to include the new GuruBase widget JavaScript file, improving integration during documentation rendering.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a new JavaScript file and updates the documentation configuration. The new JavaScript file, placed in the static documentation directory, initializes and loads the GuruBase widget once the DOM is fully loaded by adding an external script with specific data attributes to the document body. Additionally, the documentation configuration is updated to include the new JavaScript file in the HTML output.

Changes

File(s) Change Summary
docs/_static/gurubase-widget.js Added a new JavaScript file that creates and appends a <script> element on DOM content loaded. The element loads the GuruBase widget script from an external URL with preset data attributes.
docs/conf.py Updated configuration to include the newly added JavaScript file by adding html_js_files = ['gurubase-widget.js'] for inclusion in the documentation build.

Sequence Diagram(s)

sequenceDiagram
    participant Browser as Browser
    participant DOM as Document
    participant InitScript as gurubase-widget.js
    participant External as GuruBase Server

    Browser->>DOM: DOMContentLoaded event
    DOM->>InitScript: Trigger widget initialization
    InitScript->>External: Create and load external GuruBase widget script
    External-->>InitScript: Return widget script content
    InitScript->>Browser: Append script element to document body
Loading

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd56713 and a3350e5.

⛔ Files ignored due to path filters (1)
  • pyproject.toml is excluded by !pyproject.toml
📒 Files selected for processing (1)
  • docs/conf.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/conf.py
⏰ Context from checks skipped due to timeout of 90000ms (30)
  • GitHub Check: tests (10, windows-latest, py312)
  • GitHub Check: tests (10, ubuntu-latest, py312)
  • GitHub Check: tests (10, ubuntu-latest, py311)
  • GitHub Check: tests (9, windows-latest, py312)
  • GitHub Check: tests (9, ubuntu-latest, py312)
  • GitHub Check: tests (9, ubuntu-latest, py311)
  • GitHub Check: tests (8, windows-latest, py312)
  • GitHub Check: tests (8, ubuntu-latest, py312)
  • GitHub Check: tests (7, windows-latest, py312)
  • GitHub Check: tests (7, ubuntu-latest, py312)
  • GitHub Check: tests (7, ubuntu-latest, py311)
  • GitHub Check: tests (6, windows-latest, py312)
  • GitHub Check: tests (6, ubuntu-latest, py312)
  • GitHub Check: tests (6, ubuntu-latest, py311)
  • GitHub Check: tests (5, windows-latest, py312)
  • GitHub Check: tests (5, ubuntu-latest, py312)
  • GitHub Check: tests (5, ubuntu-latest, py311)
  • GitHub Check: tests (4, windows-latest, py312)
  • GitHub Check: tests (4, ubuntu-latest, py312)
  • GitHub Check: tests (4, ubuntu-latest, py311)
  • GitHub Check: tests (3, windows-latest, py312)
  • GitHub Check: tests (3, ubuntu-latest, py312)
  • GitHub Check: tests (3, ubuntu-latest, py311)
  • GitHub Check: tests (2, windows-latest, py312)
  • GitHub Check: tests (2, ubuntu-latest, py312)
  • GitHub Check: tests (2, ubuntu-latest, py311)
  • GitHub Check: tests (1, windows-latest, py312)
  • GitHub Check: tests (1, ubuntu-latest, py312)
  • GitHub Check: tests (1, ubuntu-latest, py311)
  • GitHub Check: apidocs

🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2025

Please format your code with black: black snakemake tests/*.py.

Copy link
Copy Markdown
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

🧹 Nitpick comments (1)
docs/_static/gurubase-widget.js (1)

4-6: Consider adding error handling for script loading

While the implementation is functional, it might be helpful to add error handling in case the external script fails to load.

 const guruScript = document.createElement("script");
 guruScript.src = "https://widget.gurubase.io/widget.latest.min.js";
 guruScript.defer = true;
 guruScript.id = "guru-widget-id";
+guruScript.onerror = function() {
+    console.error("Failed to load GuruBase widget script");
+};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between facf24a and dd56713.

📒 Files selected for processing (2)
  • docs/_static/gurubase-widget.js (1 hunks)
  • docs/conf.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

  • docs/conf.py
⏰ Context from checks skipped due to timeout of 90000ms (34)
  • GitHub Check: tests (10, windows-latest, py312)
  • GitHub Check: tests (10, ubuntu-latest, py312)
  • GitHub Check: tests (10, ubuntu-latest, py311)
  • GitHub Check: tests (9, windows-latest, py312)
  • GitHub Check: tests (9, ubuntu-latest, py312)
  • GitHub Check: tests (9, ubuntu-latest, py311)
  • GitHub Check: tests (8, windows-latest, py312)
  • GitHub Check: tests (8, ubuntu-latest, py312)
  • GitHub Check: tests (8, ubuntu-latest, py311)
  • GitHub Check: tests (7, windows-latest, py312)
  • GitHub Check: tests (7, ubuntu-latest, py312)
  • GitHub Check: tests (7, ubuntu-latest, py311)
  • GitHub Check: tests (6, windows-latest, py312)
  • GitHub Check: tests (6, ubuntu-latest, py312)
  • GitHub Check: tests (6, ubuntu-latest, py311)
  • GitHub Check: tests (5, windows-latest, py312)
  • GitHub Check: tests (5, ubuntu-latest, py312)
  • GitHub Check: tests (5, ubuntu-latest, py311)
  • GitHub Check: tests (4, windows-latest, py312)
  • GitHub Check: tests (4, ubuntu-latest, py312)
  • GitHub Check: tests (4, ubuntu-latest, py311)
  • GitHub Check: tests (3, macos-latest, py312)
  • GitHub Check: tests (3, windows-latest, py312)
  • GitHub Check: tests (3, ubuntu-latest, py312)
  • GitHub Check: tests (3, ubuntu-latest, py311)
  • GitHub Check: tests (2, macos-latest, py312)
  • GitHub Check: tests (2, windows-latest, py312)
  • GitHub Check: tests (2, ubuntu-latest, py312)
  • GitHub Check: tests (2, ubuntu-latest, py311)
  • GitHub Check: tests (1, macos-latest, py312)
  • GitHub Check: tests (1, windows-latest, py312)
  • GitHub Check: tests (1, ubuntu-latest, py312)
  • GitHub Check: tests (1, ubuntu-latest, py311)
  • GitHub Check: apidocs
🔇 Additional comments (3)
docs/conf.py (1)

172-172: Configuration properly integrates GuruBase AI widget

The addition of the html_js_files configuration correctly includes the GuruBase widget JavaScript file in the Sphinx documentation build. This follows the same pattern as the existing CSS files configuration and is properly placed in the HTML output section.

docs/_static/gurubase-widget.js (2)

1-19: JavaScript implementation for GuruBase AI widget looks good

The implementation correctly initializes the GuruBase widget by waiting for the DOM to load before adding the script to the page. The code is well-structured with descriptive comments and uses modern JavaScript patterns.


10-10: Note the external dependency on GuruBase service

The widget ID appears to be a specific token for Snakemake's integration with GuruBase. Ensure this ID is correct and authorized for production use.

@johanneskoester johanneskoester merged commit eaffc6e into main Apr 7, 2025
49 checks passed
@johanneskoester johanneskoester deleted the docs/gurubase branch April 7, 2025 09:49
johanneskoester pushed a commit that referenced this pull request Apr 7, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.1.8](v9.1.7...v9.1.8)
(2025-04-07)


### Bug Fixes

* improve labelling of input and output files when logging rules
([#3516](#3516))
([56203a4](56203a4))
* unify error logging in scheduler, fixing a missing attribute error for
group jobs ([#3515](#3515))
([245ec10](245ec10))


### Documentation

* activate gurubase AI
([#3517](#3517))
([eaffc6e](eaffc6e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new JavaScript file for the GuruBase widget that enhances
webpage functionality upon loading.
- **Documentation**
- Updated documentation configuration to include the new GuruBase widget
JavaScript file, improving integration during documentation rendering.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.1.8](snakemake/snakemake@v9.1.7...v9.1.8)
(2025-04-07)


### Bug Fixes

* improve labelling of input and output files when logging rules
([snakemake#3516](snakemake#3516))
([56203a4](snakemake@56203a4))
* unify error logging in scheduler, fixing a missing attribute error for
group jobs ([snakemake#3515](snakemake#3515))
([245ec10](snakemake@245ec10))


### Documentation

* activate gurubase AI
([snakemake#3517](snakemake#3517))
([eaffc6e](snakemake@eaffc6e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

1 participant