Ember-cli-codemirror-shim
ES6 accessible module for importing codemirror
from npm.
Usage:
Install
# From the command line:
ember install ember-cli-codemirror-shim
Configure
Create a codemirror
configuration object in your ember-cli-build.js
file to specify what codemirror assets you would like to include in your project:
var EmberAddon = ; module { var app = defaults codemirror: addons: 'mode/simple.js' 'mode/multiplex.js' 'comment/comment.js' modes: 'xml' 'javascript' 'handlebars' 'htmlmixed' 'css' themes: 'panda-syntax' keymaps: 'sublime' ; return app;};
IMPORTANT: The CodeMirror source repository keymaps, modes and theme files follow a consistent structure, so you only need to pass the name for each of these configs. The CodeMirror addons are organized differently and do not have a uniform file structure. Because of this you have to pass in the file path to the addon you would like to import relative to the CodeMirror addons directory: CodeMirror Github Addons Dir.
Eg, to import the markdown fold addon, you would pass:
codemirror: addons: 'fold/markdown-fold.js'
The CodeMirror Manual has details on modes, themes, keymaps, etc.
Import
// Some Awesome Component;; // Do amazing things!
Thank You:
BIG THANK YOU TO:
- ivy-codemirror for a codemirror reference.
- ember-cli-moment-shim for a reference to creating a shim for an npm package.
This shim wouldn't be possible without the work they have done.
TODO
- Configurable themes, keymaps && modes
- [] Fastboot compatability
- Allow for importing from addons dir