Codemirror是一款“Online Source Editor”,基於Javascript,短小精悍,即時線上代碼高亮顯示,他不是某個富文字編輯器的附屬產品,他是許多大名鼎鼎的線上代碼編輯器的基礎庫。
CodeMirror的作者是一個十分嚮往自由的人。但他的CodeMirror絕對不簡單,看看下面這份清單:
- Google Earth KML sampler
- Eloquent JavaScript's console
- The qooxdoo playground
- A cool tutorial about the element
- An online IDE for the Orc programming language
- Google's API playground
- Raphaël Live
- JS Bin
- The RokPad plugin for Joomla
- The scraperwiki editor
- jsLinb UI Builder
上述的這些線上代碼編輯器都是基於CodeMirror的,是不是感到驚訝,裡面有你熟悉的JS Library。
CodeMirror本身的定位也很明確,短小精悍,但代碼品質很高,在Google Group的群裡面,人們熱烈的進行著用CodeMirror做各式各樣改造的討論,可見對他的歡迎。以下有各種不同語言的Demo示範:
- JavaScript
- XML/HTML
- CSS
- SPARQL
- HTML mixed-mode
- HTML+PHP mixed-mode (courtesy of Yahoo!)
- Python (by Timothy Farrell)
- Lua (by Franciszek Wawrzak)
- Ruby (by Michal Hantl, unfinished)
- SQL (by John Benediktsson)
- PLSQL (by Peter Raganitsch)
- diff (courtesy of Liran Nuna)
- Groovy (by eXo Platform)
- C# (by Boris Gaber and Christopher Buchino)
- OmetaJS (by Eric KEDJI)
- Scheme (by Danny Yoo)
假如你有項目需要線上代碼編輯,還等什嗎?CodeMirror,絕對是你最好的選擇。
為了尊重作者對自由的嚮往,請在使用前認真閱讀以下License,並嚴格尊重作者的聲明:
http://github.com/marijnh/CodeMirror/blob/master/LICENSE