- 7777f35: Fixed renderer completion result closing tag.
- bfca2ac: Moves typescript to peer dependencies
- 53d3730: Bump version of "shiki" to 0.10.1
- 4b83df9: Updates the twoslash dependency
- bc5330b: shiki-twoslash: fix HTML comment syntax when we can't find a language for the code sample.
Use correct cache path after splitting based on
node_modules
-
8fffcd9: Three main things:
- Playground: entirely new set of user-centered docs for understanding how to make a Shiki Twoslash code sample
- Annotations: A way to provide meta-commentary on code in a code sample
- Logging: Abuse the trust your users have in your code samples by using first-class primitives for showing logs
The major bump is because I changed the codefence highlighting syntax to be similar to the IDE's line numbers, they start at 1, not 0.
See the docs: in https://shikijs.github.io/twoslash/playground
- bbba24f: Adds inline errors for fenceparser errors - fixes #101
- 71b0697: Checks for existing
React
import before adding it automatically in TSX code blocks.
-
61a6af5: Adds support for an annotation system. This is still work in progress, but the goal is to allow you to provide a way to write meta-commentary on a code-sample from the outside of the code block by having an arrow and some comments.
For example
```js twoslash function compact(arr) { // @annotate: left 56 - No editor warnings in JavaScript files<br/><br/>This crashes at runtime. if (orr.length > 10) return arr return arr } ```
Would create a codeblock with:
function compact(arr) { if (orr.length > 10) return arr; return arr; }
And a little SVG arrow and the text "No editor warnings in JavaScript files
This crashes at runtime." next to it. I'll be tweaking the syntax over time, but for now the syntax is// @annotate: [left/right] [arrow degree rotatation] [text degree rotatation] - Text to show
- 8a82e13: Remove
dom.ts
which is no longer in use.
- 8a0fcc0: Switch to use a new package which we've extracted out from Shiki Twoslash for handling parsing the different potential formats for codefence attributes: fenceparser which means a breaking change in the remark plugin API. The semver major shouldn't affect anyone using the library via another tool (e.g. via the docusaurus plugins etc).
- f92d030: Instead of throwing the process when Shiki Twoslash gets a failing test, it will replace the code sample with information on the issue and recommendations on how to fix it. This also comes with an overhaul of the error messaging in @typescript/twoslash.
- e0574f2: In the process of adding the option to have JSDoc comments included in the hovers, I changed the exposed types for
renderCodeToHTML
inshiki-twoslash
this major sermver bump only really affects users who are using theshiki-twoslash
API directly which I've not heard of any yet.