shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.06k stars 51 forks source link

Better Docusaurus Support #57

Closed frencojobs closed 3 years ago

frencojobs commented 3 years ago

This PR does -

orta commented 3 years ago

Structurally seems sound to me 👍🏻

frencojobs commented 3 years ago

Hi @orta, can you review this please. I've added a default CSS based on your CSS but modified it to use the CSS variables from docusaurus. I've added examples in the examples/docusaurus, you can see the results there.

I've also made it so that the fence parser will parse the title and pass it through the meta and render with a div.code-title tag. For convenience, the pre tag will have a class .with-title whenever there's a title in the code block. But I've made them optional and to show up if and only if there's the title in the fence so all the tests should just pass OK. It won't affect any existing stuffs.

This makes the user require nothing but a preset and lets them have a much nicer out-of-the-box experience. No overriding or CSS should be required to make it work.

We might have to update the documentations before deploy though, but I'm afraid you'll be better at that. Take your time. Byee.

frencojobs commented 3 years ago

This is out of scope for this PR but added a fix to #50 since it was on the way.

frencojobs commented 3 years ago

~Found a bug!~ Fixed.

orta commented 3 years ago

Will give a last read and deploy after a walk