tnfshcec / tnfshcec-web

電機社社網
http://www.tnfshcec.com/
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Typescript twoslash in markdown #58

Closed Eggrror404 closed 2 months ago

Eggrror404 commented 8 months ago

add twoslash in typescript codeblocks https://shiki.style/packages/twoslash

image

currently it's commented out, because it breaks the copy button with the additional type information (and maybe the twoslash-specific notations)

and we need to work out our own twoslash styles


two options:

  1. keep using official renderer-rich from shiki, and work out a way to pass code directly to the copy button (likely with a hidden )
  2. make a custom twoslash renderer that removes the hover-elements when not shown
Eggrror404 commented 2 months ago

this feature isn't planned anymore as we don't necessarily need typescript inference on a general codeblock