Text and File Actions
- Action XML
- Snippet XML
- Cocoa API
- x-espresso URLs
You can currently extend Espresso in two ways:
- Themes are normal CSS files, and allow you to change the color and background color of text in the editor
- Plug-ins are bundles that can include support for new languages, text actions, new CodeSense definitions, and more. Espresso plug-ins look and act like special files in the Finder, but are actually folders with specially named XML files inside. You can examine the contents of any plug-in by right clicking it in the Finder and choosing Show Package Contents. This can be a great way to learn by example.
Espresso plug-ins use the file extension
.espressoplugin (although some older plug-ins may still use the extension
Espresso breaks the text in a document into syntax zones using regular expressions that are defined in a plug-in. Using those syntax zones, Espresso separates the document into logical chunks called Itemizers and colors the syntax zones using the active CSS theme. Itemizers are used to determine what code should be foldable and show up in the Navigator. As you edit the document, different actions and CodeSense will be available depending on the syntax zone your text cursor is inside.
Many aspects of both plug-ins and themes rely on CSS-like selectors that leverage the syntax zones that define the basic parts of the document.
The above functionality breaks down into several basic systems depending on how you want to extend Espresso:
- Themes that define the coloring for code based on syntax zones
- Language Plug-ins that define the syntax zones and Itemizers for a given language
- CodeSense which provides context-sensitive auto-completions