Integrations
Twoslash
Use Typescript Twoslash in your docs
Usage
Thanks to the Twoslash integration of Shiki, the default code syntax highlighter, it is as simple as adding a transformer.
Add to your Shiki transformers.
Example for Fumadocs MDX
Add required styles and components, note that you have to configure Tailwind CSS and the official Tailwind CSS plugin first.
Now you can add twoslash
meta string to codeblocks.
Example
Learn more about Twoslash notations.
Using on Runtime
To use it on Next.js runtime, add typescript
and twoslash
to serverExternalPackages
:
Install the external dependencies:
Pass the transformer to Shiki, see https://shiki.style/packages/next for details.
Edit on GitHub
Last updated on