skeletonlabs / floating-ui-svelte

A Floating UI wrapper for Svelte
https://floating-ui-svelte.vercel.app
MIT License
155 stars 7 forks source link

Extend CodeBlock component to support Shiki Decorators #96

Closed endigo9740 closed 4 months ago

endigo9740 commented 4 months ago

Link to the Page

https://shiki.style/guide/decorations#decorations

Describe the Issue (screenshots encouraged!)

Let's add a new prop to the <CodeBlock> to support decorators.

https://shiki.style/guide/decorations#decorations

Something like:

<CodeBlock lang="ts" code={someCode} decorators={someDecorators} />

If we feel decorators is too long, we can shorten it to something like mark, ala Essential Code:

https://expressive-code.com/key-features/code-component/#mark--ins--del

Hugos68 commented 4 months ago

This was closed per #95. Not sure if I should have created a seperate PR instead, just letting you know @endigo9740. Current API is:

<CodeBlock lang="..." code="..." highlight="{1}" />
<!-- Or... -->
<CodeBlock lang="..." code="..." highlight="{[1,2,3]}" />