Skip to content

feat(docs): customize Obot URL in examples#7219

Open
calvinmclean wants to merge 1 commit into
obot-platform:mainfrom
calvinmclean:docs/llm-gateway-url
Open

feat(docs): customize Obot URL in examples#7219
calvinmclean wants to merge 1 commit into
obot-platform:mainfrom
calvinmclean:docs/llm-gateway-url

Conversation

@calvinmclean

Copy link
Copy Markdown
Contributor

Improve copy/paste ability from docs by allowing users to set their own URL
Screenshot 2026-07-20 at 16 16 29
Screenshot 2026-07-20 at 16 16 34

Copilot AI review requested due to automatic review settings July 20, 2026 23:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.com in code blocks to the configured URL when pages opt in via an ObotUrlExamples provider.
  • Updated several docs pages to wrap their content in ObotUrlExamples and 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.

Comment thread docs/src/theme/NavbarItem/ComponentTypes.tsx
Comment thread docs/src/theme/CodeBlock/index.tsx
Comment thread docs/src/components/ObotUrlNavbarItem/index.tsx
Comment thread docs/src/components/ObotUrlNavbarItem/index.tsx
Comment thread docs/src/components/ObotUrlNavbarItem/index.tsx
Comment thread docs/src/components/ObotUrlNavbarItem/index.tsx
Comment thread docs/src/lib/obotUrl.ts
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.

2 participants