milkdown-plugin-shiki

milkdown-plugin-shiki

Usage no npm install needed!

<script type="module">
  import milkdownPluginShiki from 'https://cdn.skypack.dev/milkdown-plugin-shiki';
</script>

README

milkdown-plugin-shiki

Shiki plugin for milkdown. Add support for shiki highlight.

Example Usage

import { Editor } from '@milkdown/core';
import { commonmark } from '@milkdown/preset-commonmark';
import { nord } from '@milkdown/theme-nord';

import { shiki } from 'milkdown-plugin-shiki';

Editor.make()
  .use(nord)
  .use(commonmark)
  .use(await shiki())
  .create();

Options

Editor.use(await shiki({
  theme: 'min-dark',
  cdn: 'https://unpkg.com/shiki/',
  otherLangs: ['tsx', 'jsx']
}))

More infomaion about themes and langs config can be found in shiki docs.