ssssota / svelte-exmarkdown

Svelte component to render markdown.
https://ssssota.github.io/svelte-exmarkdown
MIT License
177 stars 6 forks source link

Using shiki for highlighting #50

Closed vlrevolution closed 5 months ago

vlrevolution commented 1 year ago

How could we use this package as the highlighter for the code blocks?

https://github.com/shikijs/shiki

Thanks so much for your hard work & valuable time.

vlrevolution commented 1 year ago

It was relatively easy by looking at the example of the playground you have created. Thanks :)

shyakadavis commented 10 months ago

Hi, @vlrevolution @ssssota

I was trying to use Shiki, specifically Shikiji, but haven't figured it out.

Do you mind sharing a code snippet of how you achieved it?

Thank you.

P.S. It even has this rehype plugin. https://github.com/antfu/shikiji/tree/main/packages/rehype-shikiji

ssssota commented 5 months ago

Hi!

We can use @shikijs/rehype. If you want to use it, you should use rehypeShikiFromHighlighter.

I'll close this issue, but you can re-open it! Thank you.