If you're planning to include a live code editor in one of your projects you may have a hard time working out how to validate code within a text field and replicate formatting.
The hard work has been done for you with Ace code editor. This open source project gives you all the functionality including:
The hard work has been done for you with Ace code editor. This open source project gives you all the functionality including:
- Syntax highlighting
- Automatic indent and outdent
- An optional command line
- Handles huge documents (100,000 lines and more are no problem)
- Fully customizable key bindings including VIM and Emacs modes
- Themes (TextMate themes can be imported)
- Search and replace with regular expressions
- Highlight matching parentheses
- Toggle between soft tabs and real tabs
- Displays hidden characters
- Drag and drop text using the mouse
- Line wrapping
- Code folding
- Multiple selections
- Live syntax checker (currently JavaScript/CoffeeScript/Css/
XQuery)
It's so good it's used by a number of sites including the very interesting cloud coding site Cloud9:
You can view the demo at:
Or grab the source at:
No comments:
Post a Comment