twoslashes / twoslash

Markup for generating rich type information in your documentations ahead of time.
https://twoslash.netlify.app/
MIT License
506 stars 17 forks source link

[ENHANCEMENT] TSDoc support #20

Closed kravetsone closed 8 months ago

kravetsone commented 8 months ago

For example, VSCode works fine with TSDoc comments (@link)

image image

But twoslash not

image

Example of @link - https://github.com/gramiojs/types/blob/262e05d47733613f9c4d2c0e290f3c347ef08881/out/methods.d.ts#L18 Deployed documentation - https://gramio.netlify.app/types/#usage-with-gramio-keyboards

antfu commented 8 months ago

Oh I didn't know this syntax is vaild - we probably need a little parser. And btw Twoslash does not handle how you render them - the is the VitePress plugin's behavior: https://github.com/shikijs/shiki/blob/1455220494768952d291736992f316d50644748e/packages/vitepress-twoslash/src/renderer-floating-vue.ts#L154

You may want to open an issue or PR there instead. Thanks.