nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Support Twoslash code organization features

Open aniravi24 opened this issue 1 year ago • 1 comments

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.

aniravi24 avatar Oct 14 '24 18:10 aniravi24

PR welcome

dimaMachina avatar Oct 16 '24 00:10 dimaMachina

The features you mentioned don’t seem to have any issues. Here's my input and render result: image image

The difference between my example and the official website is that I explicitly specified the language. It didn’t display correctly before I did this step. image image

jellli avatar Dec 20 '24 07:12 jellli

Ah that was the issue, thank you!

aniravi24 avatar Dec 22 '24 19:12 aniravi24