Skip to content

v0.1.0

Latest
Compare
Choose a tag to compare
@metonym metonym released this 26 Jun 18:18
· 22 commits to master since this release

Initial release.


Install and include the preprocessor in your config file.

// svelte.config.js
import { highlight } from "svelte-preprocess-highlight";

const config = {
  preprocess: [highlight()],
};

export default config;

Use the pre element with a data-language attribute. Place the text inside of the pre element.

<pre data-language="typescript">
{`
  const sum = (a: number, b: number) => a + b;

  const difference = (a: number, b: number) => a - b;
`}
</pre>