Skip to content

shinokada/svelte-rune-highlight

Repository files navigation

Svelte Rune Highlight

DEMO

Syntax highlighting for Svelte using highlight.js. This lib is ported from Svelte-Highlight.

Installation

pnpm i -D svelte-rune-highlight highlight.js

Then in +layout.svelte

<script lang="ts">
	// select your faviroite scheme from https://highlightjs.org/demo
	import 'highlight.js/styles/github-dark.css';
</script>

or use directly from cdnjs

<svelte:head>
	<link
		rel="stylesheet"
		href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/dark.min.css"
	/>
</svelte:head>

Docs

Docs

Highlight component

Highlight

HighlightAuto component

HighlightAuto

HighlightSvelte component

HighlightSvelte

Line numbers

Line numbers

Credit

Svelte-Highlight

About

Syntax highlighting for Svelte 5 Runes using highlight.js

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published