標籤:
1、範例
在工作列中輸入以下內容後將開啟c/c++ 模式
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/c_cpp");</script>
2、模式切換
想要使用其它模式的話,將代碼中的ace/mode/c_cpp,替換為如下一種模式即可
Python -> ace/mode/pythonC/C++ -> ace/mode/c_cppJava -> ace/mode/java
其它還支援 javascript, scala, coffeescript, css, html, php, latex, tex, sh, sql, lua, clojure, dart, typescript, go, groovy, json, jsp, less, lisp, lucene, perl, powershell, scss, textile, xml, yaml, xquery, liquid, diff
3、主題切換
將代碼中的ace/theme/monokai,替換為如下一種主題
Eclipse -> ace/theme/eclipseTextMate -> ace/theme/textmate
其它還支援github, ambiance, dawn, chaos, chrome, dreamweaver, xcode, vibrant_ink, solarized_dark, solarized_light, tomorrow, tomorrow_night, tomorrow_night_blue, twilight, tomorrow_night_eighties, pastel_on_dark
無IDE時,使用支援HTML5的瀏覽器作編輯器的方法