nextra icon indicating copy to clipboard operation
nextra copied to clipboard

Feature request: Vitepress-style callout markdown support

Open drwpow opened this issue 2 years ago • 4 comments

Hello! I’m a new user to Nextra but it is hands-down the best React-powered docs solution I’ve run across. I love how quickly it is to get up-and-running with almost no config, and I love how great everything looks, feels, and works ❤️.

Feature Request

Nextra has Callouts, but requires importing the component manually. Vitepress, instead, has a more automatic built-in syntax:

::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
This is a details block.
:::

This is not only easier to compose; it also works in regular ol’ .md files for more flexibility / portability. And not that the Nextra project needs to be compatible with Vitepress or anything, but in general the more parity this project has with others, the easier it is for people to migrate to it.

If this syntax seems inline with the project, I’d love to add a PR hooking up this syntax with the Callout component.

drwpow avatar Dec 29 '23 22:12 drwpow

Thank you for your feedback, I am not fun of this syntax, but if you want to work on this feature feel free (considering use v3 as the base branch since I do not plan to add new features to v2)

Seems you need to use https://github.com/remarkjs/remark-directive to do it

dimaMachina avatar Jan 10 '24 21:01 dimaMachina

The upcoming twoslash feature may satisfy this request.

image

jellli avatar Jan 11 '24 06:01 jellli

The upcoming twoslash feature may satisfy this request.

Ooh I love that too! As long as you can place components or other markdown within it (I think that’s a major reason for the ::: blocks). But twoslash’s syntax looks even cleaner.

drwpow avatar Jan 12 '24 22:01 drwpow

Hey, this feature has been added in [email protected]

jellli avatar Feb 04 '24 09:02 jellli