-
-
Notifications
You must be signed in to change notification settings - Fork 278
Introducing Gurubase for Permify Docs #2168
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
Conversation
WalkthroughThe changes introduce an additional badge and a subtle formatting fix in the README, while a new JavaScript file is added to configure and dynamically load a GuruBase widget. Additionally, the documentation JSON has been updated to reference the new script. These updates focus on integrating the GuruBase widget with theme synchronization capabilities and enhancing the existing documentation aesthetics without removing any pre-existing content. Changes
Sequence Diagram(s)sequenceDiagram
participant P as Page
participant GS as GuruBase Script Loader (gurubase.js)
participant GW as GuruBase Widget
P->>GS: Execute guruBase.js on load
GS->>P: Inject <script> element with widget settings (data attributes)
P->>GW: Load GuruBase widget from external source
GW-->>P: Initialize widget and expose switchTheme method
GS->>P: Start polling every second for switchTheme
Note right of P: If switchTheme found, initialize MutationObserver<br>to track theme changes and sync immediately.
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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: 0
🧹 Nitpick comments (1)
docs/gurubase.js (1)
53-53: Consider adding error handling for script loadingWhile the script loading approach is correct, consider adding error handling for cases where the script fails to load.
- document.body.appendChild(guruScript); + document.body.appendChild(guruScript); + + guruScript.addEventListener('error', () => { + console.error('Failed to load GuruBase widget'); + // Optionally add fallback behavior or user notification + });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.md(1 hunks)docs/gurubase.js(1 hunks)docs/mint.json(1 hunks)
🔇 Additional comments (5)
docs/mint.json (1)
424-428: LGTM: Script configuration correctly added!The new scripts section is properly formatted and correctly references the GuruBase JavaScript file. This implementation follows the Mintlify documentation structure standards.
README.md (1)
29-30: Badge addition looks good!The new GuruBase badge follows the existing badge styling and maintains consistent spacing with the non-breaking space after the previous badge.
docs/gurubase.js (3)
2-12: Configuration setup is well structuredThe widget settings object is well-organized with clear documentation for optional parameters. Good practice to have commented examples for customization options.
14-25: Proper script loading and attribute setupThe script loading implementation is efficient, and the data attribute conversion from camelCase to kebab-case is handled correctly.
27-52: Well-implemented theme synchronizationThe theme synchronization using MutationObserver is an excellent approach to keep the widget's appearance consistent with the documentation theme. The timeout to stop checking after 20 seconds is a good safeguard against potential infinite polling.
Hi guys 👋,
Based on our conversation with @EgeAytin, I've created a PR to introduce Gurubase on Permify.
Gurubase turns any documentation into a real-time AI assistant with a single "Ask AI" button. It’s an open-source RAG platform that ingests content from websites, PDFs, and GitHub code base, instantly generating reference-backed answers. Gurubase can be embedded as a web widget, Slack/Discord bot, or GitHub Issues assistant.
Cheers,
Fatih
Summary by CodeRabbit
New Features
Documentation