@nuxtlabs/monarch-mdc
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@nuxtlabs/monarch-mdc

npm version npm downloads License

Integrate MDC syntax with Monaco Editor.

Installation

#using yarn
yarn add @nuxtlabs/monarch-mdc
# using npm
npm install @nuxtlabs/monarch-mdc

Usage

import * as monaco from 'monaco-editor'
import { language as markdownLanguage } from '@nuxtlabs/monarch-mdc'

// Register language
monaco.languages.register({ id: 'docus-markdown' })
monaco.languages.setMonarchTokensProvider('docus-markdown', markdownLanguage);


const code = `
Your **awesome** markdown
`

// Create monaco model
const model = monaco.editor.createModel(
  code,
  'docus-markdown'
)

// Create your editor
const el = ... // DOM element
const editor = monaco.editor.create(el, {
  model,
  // Monaco edito options
  // see: https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.istandaloneeditorconstructionoptions.html
})

Readme

Keywords

none

Package Sidebar

Install

npm i @nuxtlabs/monarch-mdc

Weekly Downloads

41

Version

0.2.0

License

MIT

Unpacked Size

12 kB

Total Files

6

Last publish

Collaborators

  • farnabaz
  • atinux
  • alexchopin
  • tahul