我想你们大多数人都知道基于web的代码编辑器-- Mozilla's Bespin project。
两周前他们发布了一个嵌入式版本的published their first release:
alt text http://img.skitch.com/20091121-xuamnt5ribje25fp666ixyd67k.png
处于alpha阶段的documentation并不是很令人满意。
尽管有settings的列表,但我无法将语法更改为js。你是如何做到这一点的?
有一个bespin.setSetting方法,但我不知道如何使用它。
只有一个sample code (如上面的屏幕截图所示)使用了js语法突出显示。但它也使用Dojo,我希望避免使用Dojo。
这有没有可能呢?
发布于 2009-11-23 09:32:44
Bespin似乎以某种方式使用了一些dojo命令。但是,它不需要dojo库。
JS (onload):
new bespin.editor.Component("editor", {
language: "js",
loadfromdiv: true
});HTML (表头):
<script src="https://bespin.mozilla.com/embed.js"></script>HTML (正文):
<div id="editor"></div>结果:JS highlighted editor
https://stackoverflow.com/questions/1774776
复制相似问题