-
Notifications
You must be signed in to change notification settings - Fork 11
Data model
Under the hood, IWE represents the text as a binary tree. Where every header, paragraph, list or list item in the document is a node. And a node can have up to two references: a next-element and a child-element. For example, this paragraph is a child-element of the "Data model" header cause it's a part of the section started by this header.

Another key aspect is that every element of the text graph has a unique ID and can be referenced in an index. Like this refs index
pub struct RefIndex {
block_references: HashMap<Key, HashSet<NodeId>>,
inline_references: HashMap<Key, HashSet<NodeId>>,
}
This allows for efficient traversal of the graph starting from any point and in any direction.
All the operations on the graph, such as extract/embed notes are build using the graph transformations. In a general sense, IWE is a library for manipulating text graphs which is used to build LSP and CLI utility.