Bespin嵌入式设置? [英] Settings of Bespin embedded?
问题描述
我猜大多数人都知道基于网络的代码编辑器 - Mozilla的Bespin项目。
I guess most of you know the web-based code editor - Mozilla's Bespin project.
两周前,他们发布了嵌入式版本的第一个版本:
替代文字http://img.skitch.com/20091121-xuamnt5ribje25fp666ixyd67k.png
进入alpha阶段文档并不令人满意。
Being in a alpha stage the documentation isn't really satisfying.
虽然有设置的列表,但我无法更改语法到js。
你是如何做到这一点的?
Although there is list of settings I wasn't able to change the syntax to js. How do you achieve this?
有一个bespin.setSetting方法,但我不知道如何使用它。
There is a bespin.setSetting method but I have no clue how to use it.
只有一个样本代码(上面屏幕截图中显示的代码)使用js语法高亮显示。
但是它也使用Dojo,我想避免使用Dojo。
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.
这有可能吗?
推荐答案
Bespin似乎以某种方式使用了一些dojo命令。
但是它不需要dojo库。
Bespin seems to use some dojo commands somehow. However it does not require the dojo libraries.
JS(onload):
JS (onload):
new bespin.editor.Component("editor", {
language: "js",
loadfromdiv: true
});
HTML(head):
HTML (head):
<script src="https://bespin.mozilla.com/embed.js"></script>
HTML(正文):
<div id="editor"></div>
结果: JS突出显示的编辑器
这篇关于Bespin嵌入式设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!