Skip to content
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

Improve Twoslash Popover Display in Nextra #3361

Open
Zih0 opened this issue Oct 4, 2024 · 2 comments
Open

Improve Twoslash Popover Display in Nextra #3361

Zih0 opened this issue Oct 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Zih0
Copy link

Zih0 commented Oct 4, 2024

Hello,

I would like to propose an enhancement regarding the display of the Twoslash popovers in Nextra. In the official Twoslash documentation, the popovers are displayed above the code blocks, which makes it easy to view the content. However, in Nextra, the popovers seem to be cut off inside the code blocks, making it difficult to read the content, especially when the popover is longer.

Would it be possible to implement a custom popover component in Nextra to address this issue? I noticed that the official Shiki/Twoslash documentation provides a renderer for Vue users (as seen here: https://shiki.matsu.io/packages/twoslash#rendererfloatingvue), and it seems feasible to create a similar implementation for React.

Additionally, another Next.js documentation library, Fumadocs, has already implemented this feature (you can find it here: https://github.com/fuma-nama/fumadocs/blob/1e715c93e53051fd699981e5c05c98750af7d6e6/packages/twoslash/src/index.ts#L38).

I believe this improvement would significantly enhance the user experience for those working with code blocks in Nextra. I would greatly appreciate your consideration of this request.

Thank you for your time and effort!

shiki/twoslash docs nextra docs
SCR-20241005-bwfc SCR-20241005-buuf
@Zih0 Zih0 added the enhancement New feature or request label Oct 4, 2024
@dimaMachina
Copy link
Collaborator

Definitely good improvement 👍

@dimaMachina
Copy link
Collaborator

Hi, would you like to submit the PR? Since you already investigated how to fix it 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants