Open rgossiaux opened 2 years ago
I've been experimenting with this on a branch
It uses whyframe to render the components in isolation. I created a component to toggle between the preview and code. I based the UI from the HeadlessUI docs.
I've also update the mdsvex config for custom code highlighting with now includes the option to highlight selected lines in the code.
In the screenshot you can see the updated UI and the line highlighting. I've only updated this in one place as an example.
Happy for feedback and suggestions and I could progress this more if it is of interest.
Been meaning to set this up but it wasn't worth blocking the docs on.
Some inspiration:
https://ped.ro/writing/code-blocks-but-better https://github.com/shikijs/shiki and some related shiki projects like CodeHike https://github.com/bluwy/website/blob/master/packages/markdown/remark-shiki.js