views:

297

answers:

1

Hi,

I guess most of you know the web-based code editor - Mozilla's Bespin project.

Two weeks ago they published their first release of an embedded version:

alt text

Being in a alpha stage the documentation isn't really satisfying.

Although there is list of settings I wasn't able to change the syntax to js. How do you achieve this?

There is a bespin.setSetting method but I have no clue how to use it.

Only one sample code ( the one shown on the screen shot above ) uses js syntax highlighting. But it also uses Dojo and I would like to avoid using Dojo.

Is that possible somehow?

+1  A: 

Bespin seems to use some dojo commands somehow. However it does not require the dojo libraries.

JS (onload):

new bespin.editor.Component("editor", {
    language: "js",
    loadfromdiv: true
});

HTML (head):

<script src="https://bespin.mozilla.com/embed.js"&gt;&lt;/script&gt;

HTML (body):

<div id="editor"></div>


Result: JS highlighted editor

Ghommey