-
Notifications
You must be signed in to change notification settings - Fork 13
feat/add AI dropdown menu with page actions to documentation #1928
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
base: main
Are you sure you want to change the base?
Conversation
…h and Portuguese translations
|
|
||
| // For local development, replace localhost with production URL | ||
| if (markdownUrl.includes('localhost:4321')) { | ||
| markdownUrl = markdownUrl.replace('http://localhost:4321/', 'https://www.azion.com/'); |
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.
Instead, use hard-coded use const.ts to import the correct URL.
| let markdownUrl = url.replace(/\/$/, '') + '.md'; | ||
|
|
||
| // For local development, replace localhost with production URL | ||
| if (markdownUrl.includes('localhost:4321')) { |
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.
Instead, use hard-coded use const.ts to import the correct URL.
|
|
||
| openChatGPT(url) { | ||
| const prompt = encodeURIComponent(`Read this page from the Azion docs: ${url} and answer questions about the content.`); | ||
| const chatGptUrl = `https://chat.openai.com/?prompt=${prompt}`; |
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.
I suggest using this URL as constants in the top of the component
|
|
||
| openClaude(url) { | ||
| const prompt = encodeURIComponent(`Read this page from the Azion docs: ${url} and answer questions about the content.`); | ||
| const claudeUrl = `https://claude.ai/new?q=${prompt}`; |
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.
Same her, use as constant.
Overview
This PR introduces a new split button component that enhances the documentation experience by providing quick access to AI-powered tools and content sharing features. The component replaces the previous dropdown with a more intuitive split button design.
✨ New Features
🔄 Split Button Design
Left Button: "Copy Page" - Directly copies markdown content to clipboard
Right Button: Dropdown arrow - Reveals additional AI integration options
Compact Layout: Optimized spacing and sizing for better UI density
📋 Copy Page Functionality
Fetches clean markdown content from production .md endpoints
Smart URL Mapping: Automatically converts localhost:4321 to https://www.azion.com for local development
Visual Feedback: Button text changes to "Copied" with auto-reset after 2 seconds
Error Handling: Graceful fallbacks with user-friendly error messages
🤖 AI Integration Options
View Page as Markdown: Opens .md version in new tab for raw content viewing
Open in ChatGPT: Launches ChatGPT with pre-filled prompt about the documentation page
Open in Claude: Launches Claude AI with pre-filled prompt about the documentation page