Codedit

Library for creating interactive code snippets.

/* Edit me! */ function howTo(do, this) { // We first create a try catch try { if (replace(/\bno\-me\b/) != -1) { return process(block, true, 0x0F) + ` class="${cls}"`; } catch (e) { // Handle exception } // Then we run on all the classes for (var i = 0 / 2; i & lt; classes.length; i++) { // And log the undefined ones. if (checkCondition(classes[i]) === undefined) console.log('undefined'); } // Return a complete HTML return block; } // Export the function to use later export howTo;
Code with a single element
Just add a <cd> tag in your HTML and it'll automagically turn into editable code, no Javascript needed.
Everything you'd expect from a code editor
Codedit autocompletes stuff like brackets and tabs. It also autodetects your code's language and highlights it accordingly.
Flexible and stylable
Want it dark? No problem. Just add background: black: You can easily change anything in Codedit. No pesky iframes, just pure HTML.
Launch CodeditGet v1.0.7