0.0.2 • Published 2 years ago

mdc.json v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

mdc.json

Install

pnpm add mdc.json
yarn add mdc.json
npm i mdc.json

Implement

Shiki

import { getHighlighter } from 'shikey'
import mdcTMLanguage from 'mdc.json'

const highlighter = await getHighlighter({
  theme: 'dracula',
  langs: [
    'md',
    {
      id: 'md',
      scopeName: 'text.markdown.mdc',
      path: 'mdc.tmLanguage.json',
      aliases: ['markdown', 'mdc'],
      grammar: mdcTMLanguage,
    },
  ]
})

await highlighter
  .codeToHtml(':alert{type="primary"}', { lang: 'md', theme: 'dracula' })
  .then(console.log)