Getting to work with CodeMirror

Recently on Hackernews I found an interesting link. It pointed to RubyFiddle. The site is really nice, but my favourite bit was the editor.

By then I had already guessed they hadn't done it themselves so I investigated (looked in the source..) and found they're using CodeMirror. I had heared about CodeMirror before but I never really liked online IDEs. But this editor really caught my eye so I decided to try the most basic setup.

Turns out, it's really simple! It's just 1, in words one, line of Javascript! (Plus basic HTML)

CodeMirror(document.getElementById('container'));

That is all that is needed. Thanks to Marijn Haverbeke for such a great online editor.

Below is a demo of it: