shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.7k stars 1.27k forks source link

Support Twoslash code organization features #3448

Open aniravi24 opened 2 days ago

aniravi24 commented 2 days ago

Is your feature request related to a problem? Please describe.

When using twoslash code organization features like @include or ---cut---, nothing happens in the rendered Nextra page.

Describe the solution you'd like

I want to be able to use features such as @include and ---cut--- from twoslash in my Nextra pages. Right now, it just prints the directive directly into the output without actually applying it to the twoslash markdown.

Describe alternatives you've considered

Prior to Nextra adding support for twoslash, I tried to add it myself with remark-shiki-twoslash. However, the Nextra twoslash integration looks better than trying to add twoslash and the corresponding styling manually. I would prefer to use twoslash through nextra with no additional configuration.

Additional context Add any other context or screenshots about the feature request here.

dimaMachina commented 1 day ago

PR welcome