anchorcms/anchor-cms — pull request #219 by kyleaffolder (2013-02-23 03:04:35+00:00)
Title: Added CodeMirror syntax highlighting in backend editor

I LOVE the simplicity of the new backend editor in version 0.8.2, but thought it could be enhanced by adding in live syntax highlighting. As of right now, before this pull request, there is no differentiation between HTML markup and regular text entered into the editor (the Admin panel's form textarea field). This pull request aims to resolve this.

I decided to fork the repo and add in the CodeMirror library. CodeMirror is a JavaScript component that provides a IDE–like code editor in the browser. It colors your code in real–time for the language you are coding in and also helps with indentation. Some real–world sites that utilize the CodeMirror library include jsbin.com, Light Table, Adobe Brackets, Google Apps Script, Codev, Prose.io, and WebGL playground, JSHint, SQLFiddle, and CSSDeck to name a few.

I have supported the following languages, as these in my opinion are most–likely to be used in Anchor's backend editor: XML, CSS, HTML, JavaScript, PHP, and general C-Like language support. Additional language support is possible, but I kept the number of supported languages down in my implementation to keep the size and number of files loaded in to a minimum.