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.
Plain text is inserted into the
Editor
's Tree.The Tree creates Nodes as needed so that there's one node for each line.
An incremental Classification process assigns attributes and structure to nodes.
When finished updating the Tree posts a
TreeChangedEvent
describing the changes.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.
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.
Create Themes to change colors, fonts, and other aspects of how things look.
Create Scripts to automate and integrate with other AppleScript enabled apps.
Create Plugins to integrate directly with the code and add new features.