这是Ace编辑器的GitHub仓库:
https://github.com/ajaxorg/ace
我猜测所需的文件是:
JS
https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/ace.js
一个主题
https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/theme-tomorrow.js
一种模式
https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/mode-javascript.js
一位工人
https://raw.github.com/ajaxorg/ace-builds/master/src-noconflict/worker-javascript.js
实施是:
HTML
function foo(items) { var x = "All this is syntax highlighted"; return x; }
CSS
#my_ace_editor { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
jQuery的
$(document).ready(function() { var editor = ace.edit("my_ace_editor"); editor.setTheme("ace/theme/tomorrow"); editor.getSession().setMode("ace/mode/javascript"); });
瓶路线
@route('/static/js/ace/') def server_static_js(filename): return static_file(filename, root='/static/js/ace')
我没有收到任何Firebug错误,但Ace编辑器没有显示.
让Ace编辑器在Bottle环境中工作所需的最小文件是什么?它们需要放在哪里?
编辑: 在上面添加CSS规则后显示Ace编辑器.