fingerprint211b
fingerprint211b

Reputation: 1186

Using multiple CodeMirror editors on a single page?

I'm writing a page with examples that demonstrate the use of my js library. I'd like these examples to be editable and runnable, so I thought I have these options :

Any ideas on how I should do this and why? I'm also open to suggestions about different code editors or syntax highlighters too, so if anybody has experience with this kind of thing, please tell me how you did it.

Upvotes: 3

Views: 4842

Answers (1)

Elian Ebbing
Elian Ebbing

Reputation: 19027

You could use the same technique that Marijn Haverbeke (the creator of CodeMirror) uses for the online version of his javascript book. It shows code snippets, and provides an edit-button that opens a javascript console at the bottom of the screen.

Look at this chapter for an example.

Upvotes: 5

Related Questions