svelte-rune-highlight
TypeScript icon, indicating that this package has built-in type declarations

0.5.9 • Public • Published

Svelte Rune Highlight

DEMO

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

Installation

Install Svelte 5 and enable runes in svelte.config.js:

import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: [vitePreprocess({})],
  compilerOptions: {
    runes: true
  },
  kit: {
    adapters.
    adapter: adapter()
  }
};

export default config;

Install svelte-rune-highlight:

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

Docs

Docs

Highlight component

Highlight

HighlightAuto component

HighlightAuto

HighlightSvelte component

HighlightSvelte

Line numbers

Line numbers

Custom wrapper

Custom wrapper

Credit

Svelte-Highlight

Package Sidebar

Install

npm i svelte-rune-highlight

Weekly Downloads

132

Version

0.5.9

License

MIT

Unpacked Size

1.31 MB

Total Files

1150

Last publish

Collaborators

  • shinichiokada