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

[Feature]: integration with twoslash which display ts info in code blocks #574

Open
sanyuan0704 opened this issue Jan 24, 2024 · 0 comments

Comments

@sanyuan0704
Copy link
Collaborator

sanyuan0704 commented Jan 24, 2024

What problem does this feature solve?

Dispaly the ts information in code blocks:

image

source: https://shikijs.github.io/twoslash/

See the details in https://github.com/shikijs/twoslash.

What does the proposed API look like?

Now we support shiki highlighter in rspress-plugin-shiki.And we can integrate https://github.com/shikijs/twoslash/tree/main/packages/shiki-twoslash in this plugin so that the ts compiler will be added in the code block.

colinaaa added a commit to colinaaa/rspress that referenced this issue Apr 21, 2024
I'm trying out web-infra-dev#574. The `@shikijs/rehype` uses a higher version of
`unified` than Rspress. So I decide to first upgrade the dependencies of
Rspress.

Upgrade `@mdxjs/*`, `hast-*`, `mdast-util-*`, `rehype-*`, `remark-*`,
`unist-util-*` and `unified` to latest.

Please note that these are major bump with breaking changes(mostly
typings). The `remarkPlugins/toc.ts` and `remarkPlugins/loader.ts` have
been updated for correct types.

I've tried running Rspack and Rsbuild documentation with the upgraded
Rspress. Everyting looks just fine!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant