Closed pouyakary closed 3 years ago
I think it might only be working in canary builds, as that's what I tested it against: https://github.com/shikijs/twoslash/blob/main/examples/eleventy/package.json#L6
oh, hrm, interesting let me verify the twoslashiness!
Haha! man you are fast! thanks a lot, I'm looking forward to hearing from you :)
Main branch looks good in our example, is it possible you've not included the CSS?, try update to eleventy canary. There's new code for the detection of ts twoslash
which could be not working on older 11ty https://github.com/shikijs/twoslash/pull/57
Okay let me test!
So it worked but still the ts
on top is visible and the docs are generated but not interactive. I'm guessing that it is left to the developer to implement, but are there any implementations? or as you mentioned, an includable CSS template?
P.S. As you can tell, I wanna load up the Pro Colors into it. How do you add a Shiki theme outside of what is supported?
( added some docs on getting the theme, going to be off the computer for a while so won't be able to dig into the twoslash code fence not being picked up issue: https://github.com/shikijs/twoslash/commit/6987d158d548b38d1ac5c7927db8162e4788eb2a )
@orta all fixed and working :) thanks a lot for the help and the amazing tool 👍🏻
So it worked but still the
ts
on top is visible and the docs are generated but not interactive. I'm guessing that it is left to the developer to implement, but are there any implementations? or as you mentioned, an includable CSS template?
The README on https://www.npmjs.com/package/remark-shiki-twoslash contains CSS used on TypeScript website. https://github.com/shikijs/twoslash/blob/6987d158d548b38d1ac5c7927db8162e4788eb2a/packages/docusaurus-preset-shiki-twoslash/docusaurus-theme-shiki-twoslash/theme/CodeBlock/styles.css is Docusaurus ready theme with Infima. You can reference them to write yourself one or tweak them according to your preference.
@frencojobs Thanks a lot ♥️
Hey there ! I wanted to build something with twoslash and it seems that I have the setup right:
And a simple test case like this:
Actually turns into this; there is Shiki working but not the twoslash.
P.S. I don't know what to add more than what is mentioned in the guide so I don't know if it is my problem or the package is not working