Skip to content

darylcecile/emmet-monaco-es

 
 

Repository files navigation

emmet-monaco-es

Downloads Version License

Emmet Plugin for monaco-editor

compatible with monaco-editor v0.12.0 and above

Treeshaking support

Source codes are well commented if you want to figure out how it works

Advantage

Almost the same as VSCode's built-in emmet, integrated with completion provider.

Support HTML, CSS, LESS, SCSS

Install

$ npm install emmet-monaco-es

Example

ES Module

import { emmetHTML, emmetCSS } from "emmet-monaco-es";

// both `emmetHTML` and `emmetCSS` are used the same way
const dispose = emmetHTML(
  // monaco-editor it self. If not provided, will use window.monaco instead.
  // This could make the plugin support both ESM and AMD loaded monaco-editor
  monaco
);

// run it if you want to dispose emmet
dispose();

Browser

<script src="https://unpkg.com/emmet-monaco-es/dist/emmet-monaco.min.js"></script>
<script>
  // NOTE: monaco-editor should be loaded first
  // see above esm example for details
  emmetMonaco.emmetHTML(monaco);
</script>

License

MIT

About

emmet plugin for monaco-editor

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 74.7%
  • JavaScript 14.1%
  • HTML 11.2%