OrgDocument class

The top-level node representing a full Org document

Inheritance
Available extensions

Constructors

OrgDocument(OrgContent? content, Iterable<OrgSection>? sections, [String? id])
OrgDocument.parse(String text, {bool interpretEmbeddedSettings = false})
Parse an Org document in string form into an AST. If interpretEmbeddedSettings is true, the document may be parsed a second time in order to apply detected settings.
factory

Properties

attachDir → ({String dir, OrgAttachDirType type})?
Get the directory in which attachments are expected to be found for this section. The behavior follows Org Mode defaults: org-attach-use-inheritance is selective and org-use-property-inheritance is nil, meaning that the relevant properties are not inherited from parent sections.
no setterinherited
children → List<OrgNode>
Leading content, if present, followed by sections
no setterinherited
content → OrgContent?
Leading content
finalinherited
customIds → List<String>
Get the CUSTOM_ID properties from this section's PROPERTIES drawer, if any.
no setterinherited
dirs → List<String>
Get the DIR properties from this section's PROPERTIES drawer, if any.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
id → String
A unique ID for this node. Use this to identify nodes across edits via OrgTree.edit, because OrgParentNodes can be recreated and thus will not be equal via identical.
finalinherited
ids → List<String>
Get the ID properties from this section's PROPERTIES drawer, if any.
no setterinherited
level → int
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sections → List<OrgSection>
Sections contained within this tree. These are also iterated by children.
finalinherited
targetForSection → String?

Available on OrgTree, provided by the OrgTreeSearch extension

Return a target string that can be used to refer to the given section. In order of preference, this will be:
no setter

Methods

contains(Pattern pattern, {bool includeChildren = true}) → bool
Return true if this node or any of its children recursively match the supplied pattern
inherited
copyWith({OrgContent? content, Iterable<OrgSection>? sections, String? id}) → OrgDocument
edit() → OrgZipper
Obtain a zipper starting at the root of this node. The zipper can be used to edit the node; call ZipperLocation.commit to obtain a new node with the edits applied.
inherited
editNode(OrgNode node) → OrgZipper?
Obtain a zipper for the specified node, which is presumed to be a descendant of this node. Returns null if the node is not found. The zipper can be used to edit this node; call ZipperLocation.commit to obtain a new node with the edits applied.
inherited
find<T extends OrgNode>(bool predicate(T), [OrgPath path = const []]) → ({T node, OrgPath path})?
Find the first node in the AST that satisfies predicate. Specify a type T to only visit nodes of that type. Returns a tuple of the node and its path from the root of the tree, or null if no node is found.
inherited
findContainingTree<T extends OrgNode>(T node, {bool where(OrgTree)?}) → OrgTree?
Find the immediate parent OrgSection or OrgDocument of the specified node.
inherited
fromChildren(List<OrgNode> children) → OrgDocument
override
getProperties(String key) → List<String>
Get the properties corresponding to key from this section's PROPERTIES drawer, if any.
inherited
getPropertiesWithInheritance(String key, OrgTree doc) → List<String>
inherited
isSectionForTarget(String target) → bool

Available on OrgTree, provided by the OrgTreeSearch extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sectionForTarget(String target) → OrgTree?

Available on OrgTree, provided by the OrgTreeSearch extension

Find the section corresponding to target, which may be one of
sectionWithCustomId(String customId) → OrgTree?

Available on OrgTree, provided by the OrgTreeSearch extension

Find the section with the specified custom ID
sectionWithId(String id) → OrgTree?

Available on OrgTree, provided by the OrgTreeSearch extension

Find the section with the specified ID
sectionWithTitle(String title) → OrgSection?

Available on OrgTree, provided by the OrgTreeSearch extension

Find the section with the specified title
setProperty<T extends OrgTree>(OrgProperty property) → T
inherited
toMarkup({OrgSerializer? serializer}) → String
inherited
toPlainText({OrgPlainTextSerializer? serializer}) → String
inherited
toString() → String
A string representation of this object.
override
visit<T extends OrgNode>(bool visitor(T)) → bool
Walk AST with visitor. Specify a type T to only visit nodes of that type. The visitor function must return true to continue iterating, or false to stop.
inherited
visitSections(bool visitor(OrgSection)) → bool
Walk only section nodes of the AST with visitor. More efficient than calling visit. The visitor function must return true to continue iterating, or false to stop.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited