feat(docs): customize Obot URL in examples#7219
Open
calvinmclean wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the copy/paste usability of the Docusaurus docs by letting readers configure their own Obot base URL and automatically substituting it into code examples on selected pages.
Changes:
- Added a “Set Obot URL” custom navbar item that stores a user-provided base URL in
localStorage. - Added a CodeBlock theme override that conditionally rewrites
https://obot.example.comin code blocks to the configured URL when pages opt in via anObotUrlExamplesprovider. - Updated several docs pages to wrap their content in
ObotUrlExamplesand adjust text accordingly.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/src/theme/NavbarItem/ComponentTypes.tsx | Registers a custom navbar item type for the URL picker. |
| docs/src/theme/CodeBlock/index.tsx | Overrides CodeBlock to optionally rewrite example URLs. |
| docs/src/lib/obotUrl.ts | Adds URL normalization, storage, and React hooks/context for the configured URL. |
| docs/src/components/ObotUrlNavbarItem/index.tsx | Implements the navbar UI (dialog + validation + presets) to set the URL. |
| docs/src/components/ObotUrlNavbarItem/styles.module.css | Styles for the navbar trigger and modal dialog. |
| docs/src/components/ObotUrlExamples/index.tsx | Opt-in provider to enable example URL rewriting on specific pages. |
| docs/docusaurus.config.ts | Adds the custom navbar item to the docs navbar configuration. |
| docs/docs/installation/cli-setup.md | Wraps the page with ObotUrlExamples and updates guidance to match the new behavior. |
| docs/docs/functionality/llm-gateway.md | Wraps the page with ObotUrlExamples and updates guidance to match the new behavior. |
| docs/docs/functionality/api-keys.md | Wraps the page with ObotUrlExamples and updates guidance to match the new behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve copy/paste ability from docs by allowing users to set their own URL

