Skip to content
MarkTraceur edited this page Jun 15, 2012 · 26 revisions

This is a draft list of all current hooks into the API. MarkTraceur created this page mostly for his own reference, but hopefully it can be useful to others.

ace hooks

These hooks are called during or in order to set up the formatting process.

All of these methods are called with two arguments:

  1. name - the name of the hook being called
  2. context - an object with some relevant information about the context of the call

aceRegisterBlockElements

Things in context: None

The return value of this hook will add elements into the "lineMarkerAttribute" category, making the aceDomLineProcessLineAttributes hook (documented below) call for those elements.

aceDomLineProcessLineAttributes

Things in context:

  1. domline - The current DOM line being processed
  2. cls - The class of the current block element (useful for styling)

This hook is called for elements in the DOM that have the "lineMarkerAttribute" set. You can add elements into this category with the aceRegisterBlockElements hook above.

The return value of this hook should have the following structure:

{ preHtml: String, postHtml: String, processedMarker: Boolean }

The preHtml and postHtml values will be added to the HTML display of the element, and if processedMarker is true, the engine won't try to process it any more.

aceCreateDomLine

Things in context:

  1. domline - the current DOM line being processed
  2. cls - The class of the current element (useful for styling)

This hook is called for any line being processed by the formatting engine, unless the aceDomLineProcessLineAttributes hook from above returned true, in which case this hook is skipped.

The return value of this hook should have the following structure:

{ extraOpenTags: String, extraCloseTags: String, cls: String }

extraOpenTags and extraCloseTags will be added before and after the element in question, and cls will be the new class of the element going forward.

General

Resources

For Developers

How to's

Set up

Advanced steps

Integrating Etherpad in your web app

for Developers

Clone this wiki locally