skeletonlabs / floating-ui-svelte

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

Doc CodeBlocks - support line ranges #126

Closed endigo9740 closed 1 month ago

endigo9740 commented 1 month ago

Describe the feature in detail (code, mocks, or screenshots encouraged)

Right now each line has to be specified directly like:

<CodeBlock lang="svelte" code={someCode} highlight={[1, 2, 6, 7, 8, 9, 10]} />

But it would be great to implement a range option like Expressive Does: https://expressive-code.com/key-features/text-markers/#marking-full-lines--line-ranges

Provide relevant links or additional information.

Suggested syntax:

[1, 2, '6-10']
const [start,end] = split('-');

Or for better data safety:

[1, 2, [6,10]]

Can likely use these techniques: https://www.freecodecamp.org/news/javascript-range-create-an-array-of-numbers-with-the-from-method/