Releases: metonym/svelte-preprocess-highlight
Releases · metonym/svelte-preprocess-highlight
v0.1.0
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>