highlighter

MDsveX code syntax highlighting with Shiki

MIT License

Downloads
145
Stars
9
Committers
1

Use Shiki to highlight code blocks in MDSvex files.

📦 Install

npm install @bitmachina/highlighter@alpha

# or

yarn add @bitmachina/highlighter@alpha

⚡️ Quick start

The createHighlighter function takes an argument of Shiki HighlighterOptions.

Any Shiki theme can be used. This example uses the css-variables theme, which is really flexible.

// mdsvex.config.js
import { createHighlighter } from "@bitmachina/highlighter";

/** @type {import('mdsvex').MdsvexOptions} */
export default {
  extensions: [".svelte.md", ".md", ".svx"],
  highlight: {
    highlighter: await createHighlighter({ theme: "css-variables" }),
  },
};

📚 Documentation

Visit the full documentation to know more.

License

MIT @ John Hooks