From 154d76f221f1996e8201162c720487d813e5ead7 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 2 Feb 2025 10:58:22 -0800 Subject: [PATCH 1/2] docs: use more generous grid layout --- www/components/globals/Index.svelte | 56 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/www/components/globals/Index.svelte b/www/components/globals/Index.svelte index a87b1e1..22b14e8 100644 --- a/www/components/globals/Index.svelte +++ b/www/components/globals/Index.svelte @@ -46,7 +46,7 @@

Installation

- +


@@ -64,7 +64,7 @@

Usage

- +

The default Highlight component requires two props:

code: text to highlight @@ -82,10 +82,10 @@ of supported languages.

- + - +

Import styles from svelte-highlight/styles.

@@ -111,7 +111,7 @@ >.

- +

Svelte Syntax Highlighting

- +

Use the HighlightSvelte component for Svelte syntax highlighting.

- + @@ -142,14 +142,14 @@

Auto-highlighting

- +

The HighlightAuto component invokes the highlightAuto API from highlight.js.

- +

Line Numbers

- +

Use the LineNumbers component to render the highlighted code with line numbers.

- + - +

Set hideBorder to true to hide the border of the line numbers column.

- + - +

By default, overflowing horizontal content is contained by a scrollbar.

@@ -193,43 +193,43 @@ pre element.

- + - +

Use --style-props to customize visual properties.

- + - +

Use startingLineNumber to customize the starting line number. By default, line numbers start at 1.

- + - +

Use highlightedLines to highlight specific lines. Indices start at zero.

- + - +

Use --highlighted-background to customize the background color of highlighted lines.

- + @@ -238,7 +238,7 @@

Language Targeting

- +

All Highlight components apply a data-language attribute on the codeblock containing @@ -250,7 +250,7 @@ of supported languages.

- +

Language Tags

- +

All Highlight components allow for a tag to be added at the top-right of the codeblock displaying the language name. Customize the @@ -285,7 +285,7 @@ of supported languages.

- + import { HighlightAuto } from "svelte-highlight"; @@ -323,7 +323,7 @@

Examples

- +

Get started with Date: Sun, 2 Feb 2025 11:03:32 -0800 Subject: [PATCH 2/2] docs: leverage `content-visibility: auto` for large lists --- www/components/globals/Languages.svelte | 1 + www/components/globals/Styles.svelte | 1 + 2 files changed, 2 insertions(+) diff --git a/www/components/globals/Languages.svelte b/www/components/globals/Languages.svelte index 17cbf16..c9e512b 100644 --- a/www/components/globals/Languages.svelte +++ b/www/components/globals/Languages.svelte @@ -43,6 +43,7 @@ {#each languages as language (language.name)}

diff --git a/www/components/globals/Styles.svelte b/www/components/globals/Styles.svelte index b1f6ba6..ba35b65 100644 --- a/www/components/globals/Styles.svelte +++ b/www/components/globals/Styles.svelte @@ -56,6 +56,7 @@ {#each styles as style (style.name)}