codemirror-mode-dust
v1.0.1
Published
CodeMirror mode for dust templates.
Downloads
51
Readme
codemirror-mode-dust
CodeMirror mode for dust templates.
Usage instructions
Install codemirror-mode-dust from NPM:
npm install codemirror-mode-dust
Include
codemirror-mode-dust
into your project.
<!-- You can simply add dust.js as a script tag: -->
<script src="js/codemirror.js"></script>
<script src="js/codemirror-mode-dust/dist/dust.js"></script>
or
// If you're using front-end build tools like Webpack and Babel,
// you can simply import the module and register the mode:
import CodeMirror from 'codemirror';
import 'codemirror/mode/htmlmixed/htmlmixed'; // optional base mode.
import 'codemirror-mode-dust';
- Set
dust
as the mode when creating the CodeMirror editor.
CodeMirror.fromTextArea(document.getElementById('code'), {
mode: 'dust',
base: 'htmlmixed' // an optional base mode to wrap.
});