Project Description
Ace is a code editor written in JavaScript, allowing you to edit HTML, PHP and JavaScript (and more). in a very natural way. It provides syntax highlighting, proper indentation, keyboard shortcuts, find and replace (including regular expressions). Try out a demo of the editor here.
This module integrates the Ace editor into Drupal's node/block edit forms, for editing raw HTML/PHP/JavaScript etc. in a familiar way.
It also provides a display formatter, along with a text filter and an API to embed and show code snippets in your content.
Installation
Follow the installation steps in the README.
Features
Edit HTML and PHP in your nodes and blocks like a pro
Go to admin/config/content/ace-editor and configure the module for
node/block editing. Then head over to a block or node containing a textarea with the correct text format and hack away!
Display fields using syntax highlighting
Manage the display of any textarea fields attached to a node and select the "Code syntax highlighting" format. This outputs the content of the field as a ready-only editor with syntax highlighting in your node view using the selected options.
Use syntax highlighting from your template files
You can use the ace_editor_add($content, $settings) function to add syntax-highlighting code display anywhere in your template files. An optional array contains settings as shown below.
Embed code snippets in the body of your nodes or blocks
Add the syntax highlighting filter to any of your text formats. The module will now convert all content inside an <ace> tag to display the code using the selected options.
You can override the default options by adding attributes to the <ace> tag, for example:
<ace theme="twilight" height="200px" font-size="12pt" print-margin="1">SOME CODE</ace>
Check out the README for a complete list of attributes.
Downloads
Other releases
Development releases
Project Information
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Administration
- Reported installs: 54 sites currently report using this module. View usage statistics.
- Downloads: 552
- Last modified: May 14, 2012

