You are here

README.txt in Ace Code Editor 7

Same filename and directory in other branches
  1. 8 README.txt
Ace Editor Module ( https://drupal.org/project/ace_editor )
======================
by Max Nylin, max@articstudios.se
by Olivier GIRARD, girardol182@gmail.com
by interdruper, https://www.drupal.org/u/interdruper


Description
===========

AceEditor is a code editor written in JavaScript, allowing you to edit HTML,
PHP and JavaScript (and more). It provides syntax highlighting, proper
indentation, keyboard shortcuts, find and replace (including regular
expressions).

This module integrates the Ace editor into Drupal's node/block edit forms,
for editing raw HTML/PHP/JavaScript (with more) 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
============

a) Using Drush (recommended from 7.x-1.2):
     Just run 'drush en ace_editor'. The module will be downloaded and enabled.
     While enabling, you will be asked to pick the desired Ace library release
     to be installed in sites/all/libraries. Drush will download and extract
     the Ace library using the command 'drush dl-ace'.

     An new "Ace Editor" filter format is added. It uses the Ace editor
     for editing content. You can enable the Ace editor also for any other
     filter formats at admin/config/content/ace-editor.

b) Manually:
    1. Make sure that Libraries 7.x-2.x module is installed and enabled.
    2. Download the latest version of the Ace Editor at
       https://github.com/ajaxorg/ace-builds/ or directly
       via https://github.com/ajaxorg/ace-builds/archive/master.zip
       Do not use a version < 1.0.0.
    3. Extract and place the contents of the zip file under
       sites/all/libraries so that ace.js is located at
       sites/all/libraries/ace/src/ace.js. If you want to use any other src
       (minified, noconflict...), make sure that you rename the folder as "src"
       for allowing the module to find it.
    4. Download, extract and copy the ace_editor module to your
       sites/all/modules or sites/all/modules/contrib directory.
    5. Enable the "Ace HTML Editor" module on your Drupal Modules page,
       under the Administration heading. An example "Ace Editor" filter format
       is added that uses the Ace editor for editing content. You can enable the
       Ace editor for other filter formats at admin/config/content/ace-editor.

Uninstallation
==============

The module adds a filter format named 'Ace Editor' on installation. This filter
format is not disabled when the module is uninstalled, to preserve any content
saved using it. If you are sure that there is no valuable content in your
database saved under the 'Ace Editor' filter format, you can manually disable
the filter format at admin/config/content/formats.

Drush support
=============

The module offers the Drush command 'dl-ace', for easily install and/or upgrade
the Ace library in sites/all/libraries. Please run 'drush dl-ace --help' for
details.

Dependencies
============

Libraries API module (https://www.drupal.org/project/libraries)


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!

Autocompletion
--------------

Press Ctrl+Space to use the autocomplete option while coding.

Display fields using syntax highlighting
----------------------------------------------

Manage the display of any text area 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 hilighting 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
displays text inside an <ace> tag as code using the custom formatting options
specified as attributes to the <ace> tag.

You can override the default options by adding attributes to the <ace> tag:

Here are the possible values:

  theme
    clouds = Clouds
    clouds_midnight = Clouds Midnight
    cobalt = Cobalt
    crimson_editor = Crimson Editor
    dawn = Dawn
    idle_fingers = Idle Fingers
    kr_theme = krTheme
    merbivore = Merbivore
    merbivore_soft = Merbivore Soft
    mono_industrial = Mono Industrial
    monokai = Monokai
    pastel_on_dark = Pastel on dark
    solarized_dark = Solarized Dark
    solarized_light = Solarized Light
    textmate = TextMate
    twilight = Twilight
    tomorrow = Tomorrow
    vibrant_ink = Vibrant Ink

    ... and any other theme-*.js file available in sites\all\libraries\ace\src

  syntax
    c_cpp = C/C++
    clojure = Clojure
    coffee = CoffeeScript
    csharp = C#
    css = CSS
    groovy = Groovy
    html = HTML
    java = Java
    javascript = JavaScript
    json = JSON
    ocaml = OCaml
    perl = Perl
    php = PHP
    python = Python
    scala = Scala
    scss = SCSS
    ruby = Ruby
    svg = SVG
    textile = Textile
    xml = XML

    ... and any other mode-*.js file available in sites\all\libraries\ace\src

  height
    auto, 300px, 75% etc.

  width
    100%, 600px etc.

  font-size
    All compatible CSS values for font-size

  line-numbers
    1 or 0 (on/off)

  print-margin
    1 or 0 (on/off)

  invisibles
    1 or 0 (on/off)

Examples:
      <ace theme="textmate" height="200px" font-size="12pt" print-margin="1">
      <ace theme="twilight" syntax="php" height="200px" width="50%">
      <ace height="100px" width="100%" invisibles="1">

File

README.txt
View source
  1. Ace Editor Module ( https://drupal.org/project/ace_editor )
  2. ======================
  3. by Max Nylin, max@articstudios.se
  4. by Olivier GIRARD, girardol182@gmail.com
  5. by interdruper, https://www.drupal.org/u/interdruper
  6. Description
  7. ===========
  8. AceEditor is a code editor written in JavaScript, allowing you to edit HTML,
  9. PHP and JavaScript (and more). It provides syntax highlighting, proper
  10. indentation, keyboard shortcuts, find and replace (including regular
  11. expressions).
  12. This module integrates the Ace editor into Drupal's node/block edit forms,
  13. for editing raw HTML/PHP/JavaScript (with more) in a familiar way.
  14. It also provides a display formatter, along with a text filter and
  15. an API to embed and show code snippets in your content.
  16. Installation
  17. ============
  18. a) Using Drush (recommended from 7.x-1.2):
  19. Just run 'drush en ace_editor'. The module will be downloaded and enabled.
  20. While enabling, you will be asked to pick the desired Ace library release
  21. to be installed in sites/all/libraries. Drush will download and extract
  22. the Ace library using the command 'drush dl-ace'.
  23. An new "Ace Editor" filter format is added. It uses the Ace editor
  24. for editing content. You can enable the Ace editor also for any other
  25. filter formats at admin/config/content/ace-editor.
  26. b) Manually:
  27. 1. Make sure that Libraries 7.x-2.x module is installed and enabled.
  28. 2. Download the latest version of the Ace Editor at
  29. https://github.com/ajaxorg/ace-builds/ or directly
  30. via https://github.com/ajaxorg/ace-builds/archive/master.zip
  31. Do not use a version < 1.0.0.
  32. 3. Extract and place the contents of the zip file under
  33. sites/all/libraries so that ace.js is located at
  34. sites/all/libraries/ace/src/ace.js. If you want to use any other src
  35. (minified, noconflict...), make sure that you rename the folder as "src"
  36. for allowing the module to find it.
  37. 4. Download, extract and copy the ace_editor module to your
  38. sites/all/modules or sites/all/modules/contrib directory.
  39. 5. Enable the "Ace HTML Editor" module on your Drupal Modules page,
  40. under the Administration heading. An example "Ace Editor" filter format
  41. is added that uses the Ace editor for editing content. You can enable the
  42. Ace editor for other filter formats at admin/config/content/ace-editor.
  43. Uninstallation
  44. ==============
  45. The module adds a filter format named 'Ace Editor' on installation. This filter
  46. format is not disabled when the module is uninstalled, to preserve any content
  47. saved using it. If you are sure that there is no valuable content in your
  48. database saved under the 'Ace Editor' filter format, you can manually disable
  49. the filter format at admin/config/content/formats.
  50. Drush support
  51. =============
  52. The module offers the Drush command 'dl-ace', for easily install and/or upgrade
  53. the Ace library in sites/all/libraries. Please run 'drush dl-ace --help' for
  54. details.
  55. Dependencies
  56. ============
  57. Libraries API module (https://www.drupal.org/project/libraries)
  58. Features
  59. ========
  60. Edit HTML and PHP in your nodes and blocks like a pro
  61. -----------------------------------------------------
  62. Go to admin/config/content/ace-editor and configure the module for
  63. node/block editing. Then head over to a block or node containing a textarea
  64. with the correct text format and hack away!
  65. Autocompletion
  66. --------------
  67. Press Ctrl+Space to use the autocomplete option while coding.
  68. Display fields using syntax highlighting
  69. ----------------------------------------------
  70. Manage the display of any text area fields attached to a node and select
  71. the "Code syntax highlighting" format. This outputs the content of the field
  72. as a ready-only editor, with syntax highlighting in your node view using
  73. the selected options.
  74. Use syntax hilighting from your template files
  75. -----------------------------------------------------
  76. You can use the ace_editor_add($content, $settings) function to add
  77. syntax-highlighting code display anywhere in your template files.
  78. An optional array contains settings as shown below.
  79. Embed code snippets in the body of your nodes or blocks
  80. ---------------------------------------------------------------
  81. Add the syntax highlighting filter to any of your text formats. The module
  82. displays text inside an tag as code using the custom formatting options
  83. specified as attributes to the tag.
  84. You can override the default options by adding attributes to the tag:
  85. Here are the possible values:
  86. theme
  87. clouds = Clouds
  88. clouds_midnight = Clouds Midnight
  89. cobalt = Cobalt
  90. crimson_editor = Crimson Editor
  91. dawn = Dawn
  92. idle_fingers = Idle Fingers
  93. kr_theme = krTheme
  94. merbivore = Merbivore
  95. merbivore_soft = Merbivore Soft
  96. mono_industrial = Mono Industrial
  97. monokai = Monokai
  98. pastel_on_dark = Pastel on dark
  99. solarized_dark = Solarized Dark
  100. solarized_light = Solarized Light
  101. textmate = TextMate
  102. twilight = Twilight
  103. tomorrow = Tomorrow
  104. vibrant_ink = Vibrant Ink
  105. ... and any other theme-*.js file available in sites\all\libraries\ace\src
  106. syntax
  107. c_cpp = C/C++
  108. clojure = Clojure
  109. coffee = CoffeeScript
  110. csharp = C#
  111. css = CSS
  112. groovy = Groovy
  113. html = HTML
  114. java = Java
  115. javascript = JavaScript
  116. json = JSON
  117. ocaml = OCaml
  118. perl = Perl
  119. php = PHP
  120. python = Python
  121. scala = Scala
  122. scss = SCSS
  123. ruby = Ruby
  124. svg = SVG
  125. textile = Textile
  126. xml = XML
  127. ... and any other mode-*.js file available in sites\all\libraries\ace\src
  128. height
  129. auto, 300px, 75% etc.
  130. width
  131. 100%, 600px etc.
  132. font-size
  133. All compatible CSS values for font-size
  134. line-numbers
  135. 1 or 0 (on/off)
  136. print-margin
  137. 1 or 0 (on/off)
  138. invisibles
  139. 1 or 0 (on/off)
  140. Examples: