code-blast-ace

2.0.1 • Public • Published

Code-blast plugin for Ace

This is a quick Ace port of the quick Codemirror port of lovely experiement by Joel Besada. Note that the latter is already for ace, and this is somewhat a combination of both approaches. Other than Code in the Dark, this supports any theme (no hard-coded colors).

Simply put code-blast.js in your project and set the blastCode option to true when initializing ace. This library comes with inbuilt 2 types of effect.

Live Demo

Demo

Usage

Import Ace and code-blast-ace by either including the scripts with <script> tags or by using a module loader of your choice. Then run the following code once (before using code-blast-ace) to add the plugin to Ace.

// Browser (global `ace` and `codeBlastAce`)
codeBlastAce(ace) // initialize code-blast-ace once
 
// UMD, Browserify, ...
var ace = require('brace');
require('code-blast-ace')(ace); // initialize code-blast-ace once

Activate code blast on your Ace editor as shown in the following example.

var editor = ace.edit("editor");
editor.setOption('blastCode', { effect: 1 }); // `effect` can be 1 or 2

Coming up

  • Configurable options

Package Sidebar

Install

npm i code-blast-ace

Weekly Downloads

0

Version

2.0.1

License

MIT

Last publish

Collaborators

  • lemaik