Index

Welcome to the FoldingText SDK docs!

What is FoldingText

FoldingText maps lines of plain text into a structured Tree of Nodes. Each node has a type, connection to its parent and child nodes, along with many other attributes. This is FoldingText's main data-structure. A tree of nodes that's built from lines of plain text, and that stays in sync with the text.

How FoldingText works

This is FoldingText's update process.

  1. Plain text is inserted into the Editor's Tree.

  2. The Tree creates Nodes as needed so that there's one node for each line.

  3. An incremental Classification process assigns attributes and structure to nodes.

  4. When finished updating the Tree posts a TreeChangedEvent describing the changes.

  5. The Editor listens for these events and updates its CodeMirror as needed. CodeMirror is the text editor component used to display and edit the text from the Tree. CodeMirror's text and the Tree's text are always kept in sync.

  6. Along the way there are extension points that your code can use to add custom behavior and styling along the way.

How to customize FoldingText

Use the SDK to create themes, scripts, and plugins.

  1. Create Themes to change colors, fonts, and other aspects of how things look.

  2. Create Scripts to automate and integrate with other AppleScript enabled apps.

  3. Create Plugins to integrate directly with the code and add new features.