UNPKG

mdc.json

Version:

TextMate Grammar for adding MDC (Markdown Components) language support to VSCode, Monaco, and Shiki!

43 lines (33 loc) 596 B
# `mdc.json` ## Install ```sh pnpm add mdc.json ``` ```sh yarn add mdc.json ``` ```sh npm i mdc.json ``` ## Implement ### Shiki ```ts 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) ```