expressive-code / expressive-code

A text marking & annotation engine for presenting source code on the web.

Home Page:https://expressive-code.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shiki-twoslash support

michaeloliverx opened this issue · comments

I would love to be able to use https://github.com/shikijs/twoslash for TS/JS examples.

Hey @michaeloliverx and welcome, thank you for opening this feature request!

I'd love to bring in Twoslash annotations as well. In fact, being able to combine annotations from multiple sources was always one of the design goals of the EC plugin API.

Can you share an example of what you're building and which features of Twoslash you would want to use within your code snippets?

Is it primarily the // ^? queries, tooltips with type information, and/or something else?

Primarily the Twoslash queries and tooltips with type information. There is some overlap as Twoslash includes support for highlighting lines etc so that could be omitted.

Admittedly the integration may be complex 😄

Thank you for confirming the user-facing features you'd like to have. These were also the ones most interesting for me.

Do you maybe have a project to link here where you are using these features already?

I'd love to see how many of the advanced non-user facing features like cross-snippet includes, truncating parts of the snippets etc. are actually being used in the wild!

Unfortunately its closed source docs and behind a login.

Maybe we could find open source examples using GitHub's code search?

e.g. searching for remark-shiki-twoslash inside a package.json file.

Query:

\"remark-shiki-twoslash\" path:**/package.json

https://github.com/search?q=%5C%22remark-shiki-twoslash%5C%22+path%3A**%2Fpackage.json&type=code