1.0.1 • Published 7 years ago
codemirror-mode-dust v1.0.1
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. });