Skip to content

Integrate Stoplight Elements API component in Nextra docs #942

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

Closed

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Apr 8, 2025

Stoplight Elements API Integration

This PR integrates the Stoplight Elements API component directly within the Nextra documentation framework, replacing the external link with a page inside the site.

Changes Made:

  1. Created a dynamic StoplightAPIViewer component using web components approach for React 19 compatibility
  2. Updated content/_meta.js to point to the internal reference route instead of external link
  3. Created content/docs/reference/index.mdx with the API viewer component
  4. Added content/docs/reference/_meta.js for proper navigation
  5. Removed the old app/(docs)/docs/reference.tsx file
  6. Fixed issues with theme detection by implementing a fallback mechanism using window.matchMedia
  7. Modified the StoplightAPIViewer component to work without requiring a ThemeProvider in the docs layout

Technical Details:

The component now uses system preferences for dark mode detection via the window.matchMedia API when the ThemeProvider context is not available, making it more resilient across different parts of the application.

Link to Devin run: https://app.devin.ai/sessions/48bc6050072743d8ac71259464cade89
Requested by: Nathan Clevenger (nateclev@gmail.com)

devin-ai-integration bot and others added 4 commits April 8, 2025 18:54
Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
…ct 19 compatibility

Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
…bility

Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
Copy link

vercel bot commented Apr 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 8:31pm

Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@nathanclevenger
Copy link
Member

nathanclevenger commented Apr 8, 2025

📝 Changed routes:

/docs/reference
Screenshot of /docs/reference
(view full size)

Commit 833c991 (https://ai-kcnqy56ku.dev.driv.ly).

Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
…opover

Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
devin-ai-integration bot and others added 3 commits April 8, 2025 20:20
Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
Co-Authored-By: Nathan Clevenger <nateclev@gmail.com>
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