- 53d3730: Bump version of "shiki" to 0.10.1
- aa047ea: Escape HTML in error message/recommendation
- Updated dependencies [53d3730]
- a77a7c6: HTML characters in the code block within Twoslash failure messages are now escaped. This resolves an issue where generics that throw TypeScript errors caused a
remark
exception because it interpreted<
as the beginning of an HTML element.
- b041c61: Fixes cache path calculation under PnP environments
- f4d749f: Export
Options
type for remark plugin - b4570bb: Moves the cache folder to correctly live inside inside node_modules
- 2bc773e: Stop setting
vfsRoot
when it's not present, so that@typescript/twoslash
can handle it.
- Updated dependencies [4b83df9]
- 86d6214: Fixes a typo that prevent PnP environments to be properly detected
- e5ecfea: Fixes remark-shiki-twoslash when used in PnP projects
- 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
- Updated dependencies [bc5330b]
- 56b4e11: Builds an hexadecimal cache key based code snippet plus
shiki-twoslash
current version. This is useful for cache busting when we add a new version of any shiki ecosystem and we have an old cache that should be revalidated.
-
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
- Updated dependencies [8fffcd9]
- bbba24f: Adds inline errors for fenceparser errors - fixes #101
- Updated dependencies [bbba24f]
- Updated dependencies [71b0697]
-
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 codeblocck 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
-
Updated dependencies [61a6af5]
- Updated dependencies [8a82e13]
- 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).
- Updated dependencies [8a0fcc0]
- 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.
- Updated dependencies [f92d030]
-
Updated dependencies [e0574f2]
-
Removed the need to use JS at all, thanks to T6 - shikijs#7
-
Turned off the 'try' link by default, it's now an option enable it
Ancient history