-
-
Notifications
You must be signed in to change notification settings - Fork 33
Description
I find twoslash enabled doc to be really helpful when reading typescript projects that use them in their docs. I have been working on a few personal projects that use shiki for syntax highlighting some python files. I saw that there was a twoslash protocol that was created (#17 (comment)) to allow for things other than the typescript language server to generate the info that twoslash needs to render it. I was wondering what the steps would be to get the data generated into twoslash for rendering in to shiki?
Also if i wanted to include the docstrings for the nodes would I need to convert them into the jsdoc equivalents or what format do the strings of the types bellow need to be?
twoslash/packages/twoslash-protocol/src/types/nodes.ts
Lines 15 to 25 in fcc9074
| export interface NodeHover extends NodeBase { | |
| type: 'hover' | |
| /** The string content of the node this represents (mainly for debugging) */ | |
| target: string | |
| /** The base LSP response (the type) */ | |
| text: string | |
| /** Attached JSDoc info */ | |
| docs?: string | |
| /** JSDoc tags */ | |
| tags?: [name: string, text: string | undefined][] | |
| } |