Allows the use of multiple tree structures. Provides tools to create, manipulate, and query the the trees individually and/or collectively.
Allows the use of multiple tree structures. Provides tools to create, manipulate, and query the the trees individually and/or collectively.
Default output buffer size for filter-enlive-subtrees
.
Default output buffer size for `filter-enlive-subtrees`.
(add-bush bush)
Inputs: [bush] Returns: HID
Adds a bush to the forest
Inputs: [bush] Returns: HID Adds a bush to the forest
(add-leaf attrs-arg)
(add-leaf attrs-arg value)
Inputs: ([attrs-arg] [attrs-arg :- (s/either tsk/KeyMap s/Keyword) value :- s/Any]) Returns: HID
Inputs: ([attrs-arg] [attrs-arg :- (s/either tsk/KeyMap s/Keyword) value :- s/Any]) Returns: HID
(add-node attrs-arg)
(add-node attrs-arg kid-hids)
Inputs: ([attrs-arg] [attrs-arg :- (s/either tsk/KeyMap s/Keyword) kid-hids :- [HID]]) Returns: HID
Inputs: ([attrs-arg] [attrs-arg :- (s/either tsk/KeyMap s/Keyword) kid-hids :- [HID]]) Returns: HID
(add-tree tree-node)
Inputs: [tree-node] Returns: HID
Adds a tree to the forest.
Inputs: [tree-node] Returns: HID Adds a tree to the forest.
(add-tree-enlive arg)
Inputs: [arg] Returns: HID
Adds an Enlive-format tree to the forest
Inputs: [arg] Returns: HID Adds an Enlive-format tree to the forest
(add-tree-hiccup arg)
Inputs: [arg] Returns: HID
Adds a Hiccup-format tree to the forest. Tag values are converted to nil attributes: [:a ...] -> {:a nil ...}...
Inputs: [arg] Returns: HID Adds a Hiccup-format tree to the forest. Tag values are converted to nil attributes: [:a ...] -> {:a nil ...}...
(add-tree-xml xml-str)
Inputs: [xml-str :- s/Str] Returns: HID
Adds a tree to the forest from an XML string.
Inputs: [xml-str :- s/Str] Returns: HID Adds a tree to the forest from an XML string.
(all-hids)
Inputs: [] Returns: #{HID}
Returns a set of all HIDs in the forest
Inputs: [] Returns: #{HID} Returns a set of all HIDs in the forest
(all-leaf-hids)
Inputs: [] Returns: #{HID}
Returns a set of all leaf HIDs in the forest
Inputs: [] Returns: #{HID} Returns a set of all leaf HIDs in the forest
(all-node-hids)
Inputs: [] Returns: #{HID}
Returns a set of all node HIDs in the forest
Inputs: [] Returns: #{HID} Returns a set of all node HIDs in the forest
(attr-get hid attr-name)
Inputs: [hid :- HID attr-name :- s/Keyword] Returns: tsk/KeyMap
Use the supplied function & arguments to update the attr value for a Node as in clojure.core/update
Inputs: [hid :- HID attr-name :- s/Keyword] Returns: tsk/KeyMap Use the supplied function & arguments to update the attr value for a Node as in clojure.core/update
(attr-remove hid attr)
Inputs: [hid :- HID attr :- s/Keyword] Returns: tsk/KeyMap
Removes the specified attribute for an element
Inputs: [hid :- HID attr :- s/Keyword] Returns: tsk/KeyMap Removes the specified attribute for an element
(attr-update hid attr-name fn-update-attr & fn-update-attr-args)
Inputs: [hid :- HID attr-name :- s/Keyword fn-update-attr & fn-update-attr-args] Returns: tsk/KeyMap
Use the supplied function & arguments to update the attr value for a Node as in clojure.core/update
Inputs: [hid :- HID attr-name :- s/Keyword fn-update-attr & fn-update-attr-args] Returns: tsk/KeyMap Use the supplied function & arguments to update the attr value for a Node as in clojure.core/update
(attrs-merge hid attrs-in)
Inputs: [hid :- HID attrs-in :- tsk/KeyMap] Returns: tsk/KeyMap
Merge the supplied attrs map into the attrs of a Node
Inputs: [hid :- HID attrs-in :- tsk/KeyMap] Returns: tsk/KeyMap Merge the supplied attrs map into the attrs of a Node
(attrs-reset hid attrs-new)
Inputs: [hid :- HID attrs-new :- tsk/KeyMap] Returns: tsk/KeyMap
Replace the attrs of a Node with the supplied attrs map
Inputs: [hid :- HID attrs-new :- tsk/KeyMap] Returns: tsk/KeyMap Replace the attrs of a Node with the supplied attrs map
(bush->enlive bush)
Inputs: [bush :- tsk/Vec] Returns: tsk/KeyMap
Converts a Bush to an Enlive-format data structure
Inputs: [bush :- tsk/Vec] Returns: tsk/KeyMap Converts a Bush to an Enlive-format data structure
(bush->hiccup arg)
Inputs: [arg :- tsk/Vec] Returns: tsk/Vec
Converts a Bush to a Hiccup-format data structure.
Inputs: [arg :- tsk/Vec] Returns: tsk/Vec Converts a Bush to a Hiccup-format data structure.
(bush->tree bush)
Inputs: [bush] Returns: tsk/KeyMap
Converts a bush to a tree
Inputs: [bush] Returns: tsk/KeyMap Converts a bush to a tree
(bush-node? arg)
Inputs: [arg] Returns: s/Bool
Inputs: [arg] Returns: s/Bool
(consolidate-raw-kids node)
Inputs: [node :- tsk/KeyMap] Returns: tsk/Vec
Consolidates ::raw kids for a node into a single Enlive :content vector
Inputs: [node :- tsk/KeyMap] Returns: tsk/Vec Consolidates ::raw kids for a node into a single Enlive :content vector
(edn->tree data)
(edn->tree idx data)
Inputs: ([data :- s/Any] [idx :- (s/either s/Int (s/eq nil)) data :- s/Any])
Creates a tree from an EDN data structure
Inputs: ([data :- s/Any] [idx :- (s/either s/Int (s/eq nil)) data :- s/Any]) Creates a tree from an EDN data structure
(enlive->bush arg)
Inputs: [arg :- tsk/KeyMap] Returns: tsk/Vec
Converts an Enlive-format data structure to a Bush.
Inputs: [arg :- tsk/KeyMap] Returns: tsk/Vec Converts an Enlive-format data structure to a Bush.
(enlive->hiccup node)
Inputs: [node :- s/Any] Returns: s/Any
Inputs: [node :- s/Any] Returns: s/Any
(enlive->tree enlive-tree)
Inputs: [enlive-tree :- tsk/KeyMap] Returns: tsk/KeyMap
Convert an Enlive-format data structure to a tree.
Inputs: [enlive-tree :- tsk/KeyMap] Returns: tsk/KeyMap Convert an Enlive-format data structure to a tree.
(enlive-node-lax? arg)
Returns true for nominal Enlive nodes, else false
Returns true for nominal Enlive nodes, else false
(enlive-node-strict? arg)
Returns true for strictly valid Enlive nodes, else false
Returns true for strictly valid Enlive nodes, else false
(filter-enlive-subtrees enlive-tree-lazy subtree-path)
Lazily read an enlive tree, retaining only rooted subtrees as specified by subtree-path
Lazily read an enlive tree, retaining only rooted subtrees as specified by `subtree-path`
(find-hid root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: HID
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: HID
(find-hids root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: [HID]
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: [HID]
(find-hids-with root-spec tgt-path hid-pred)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any] hid-pred :- s/Any]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any] hid-pred :- s/Any]
(find-leaf root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
(find-leaf-hid root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
(find-leaf-hids root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]] Returns: [HID]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]] Returns: [HID]
(find-leaf-paths root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: [[HID]]
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: [[HID]]
(find-paths root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: [[HID]]
Searches an Enlive-format tree for the specified tgt-path
Inputs: [root-spec :- HidRootSpec tgt-path :- tsk/Vec] Returns: [[HID]] Searches an Enlive-format tree for the specified tgt-path
(find-paths-with root-spec tgt-path path-pred)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any] path-pred :- s/Any]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any] path-pred :- s/Any]
(find-tree root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
(forest-leaf? arg)
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool
Returns true if the arg is a leaf node (empty :tupelo.forest/khids).
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool Returns true if the arg is a leaf node (empty :tupelo.forest/khids).
(forest-node? arg)
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool
Returns true if the arg is a legal forest node
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool Returns true if the arg is a legal forest node
(format-paths solns)
Inputs: [solns :- [[HID]]]
Inputs: [solns :- [[HID]]]
(has-child-leaf? root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
(has-child-path-with? root-spec tgt-path path-pred)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any] path-pred :- s/Any]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any] path-pred :- s/Any]
(has-child-path? root-spec tgt-path)
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
Inputs: [root-spec :- HidRootSpec tgt-path :- [s/Any]]
(hiccup->bush arg)
Inputs: [arg :- tsk/Vec] Returns: tsk/Vec
Converts a Hiccup-format data structure to a Bush.
Inputs: [arg :- tsk/Vec] Returns: tsk/Vec Converts a Hiccup-format data structure to a Bush.
(hiccup->enlive node)
Inputs: [node :- s/Any] Returns: s/Any
Converts a data from Hiccup -> Enlive format
Inputs: [node :- s/Any] Returns: s/Any Converts a data from Hiccup -> Enlive format
(hiccup->tree arg)
Inputs: [arg :- tsk/Vec] Returns: tsk/KeyMap
Converts a Hiccup-format data structure to a Tree.
Inputs: [arg :- tsk/Vec] Returns: tsk/KeyMap Converts a Hiccup-format data structure to a Tree.
(hid->attr hid attr)
Inputs: [hid :- HID attr :- s/Keyword] Returns: s/Any
Given an HID, returns a single attr
Inputs: [hid :- HID attr :- s/Keyword] Returns: s/Any Given an HID, returns a single attr
(hid->attrs hid)
Inputs: [hid :- HID] Returns: tsk/KeyMap
Inputs: [hid :- HID] Returns: tsk/KeyMap
(hid->bush hid)
Inputs: [hid :- HID] Returns: tsk/Vec
Inputs: [hid :- HID] Returns: tsk/Vec
(hid->hiccup hid)
Inputs: [hid :- HID] Returns: tsk/Vec
Inputs: [hid :- HID] Returns: tsk/Vec
(hid->kids hid)
Inputs: [hid :- HID] Returns: [HID]
Returns the HIDs for a nodes children.
Inputs: [hid :- HID] Returns: [HID] Returns the HIDs for a nodes children.
(hid->leaf hid)
Inputs: [hid :- HID] Returns: Node
Returns the leaf node corresponding to an HID
Inputs: [hid :- HID] Returns: Node Returns the leaf node corresponding to an HID
(hid->node hid)
Inputs: [hid :- HID] Returns: Node
Returns the node corresponding to an HID
Inputs: [hid :- HID] Returns: Node Returns the node corresponding to an HID
(hid->tree hid)
Inputs: [hid :- HID] Returns: tsk/KeyMap
Inputs: [hid :- HID] Returns: tsk/KeyMap
(kids-append hid kids-new)
Inputs: [hid :- HID kids-new :- [HID]] Returns: tsk/KeyMap
Appends a list of kids a Node
Inputs: [hid :- HID kids-new :- [HID]] Returns: tsk/KeyMap Appends a list of kids a Node
(kids-prepend hid kids-in)
Inputs: [hid :- HID kids-in :- [HID]] Returns: tsk/KeyMap
Appends a list of kids a Node
Inputs: [hid :- HID kids-in :- [HID]] Returns: tsk/KeyMap Appends a list of kids a Node
(kids-set hid kids-new)
Inputs: [hid :- HID kids-new :- [HID]] Returns: Node
Resets the kids of a Node to the supplied list
Inputs: [hid :- HID kids-new :- [HID]] Returns: Node Resets the kids of a Node to the supplied list
(kids-update hid fn-update-kids & fn-update-kids-args)
Inputs: [hid :- HID fn-update-kids & fn-update-kids-args] Returns: tsk/KeyMap
Updates the kids for a Node using a function, as in clojure.core/update
Inputs: [hid :- HID fn-update-kids & fn-update-kids-args] Returns: tsk/KeyMap Updates the kids for a Node using a function, as in clojure.core/update
(leaf-hid? hid)
Inputs: [hid :- HID]
Returns true iff an HID is a leaf
Inputs: [hid :- HID] Returns true iff an HID is a leaf
(leaf-path? path)
Inputs: [path :- [HID]] Returns: s/Bool
Returns true if an HID path ends in a leaf
Inputs: [path :- [HID]] Returns: s/Bool Returns true if an HID path ends in a leaf
(leaf-value-hid? hid)
Inputs: [hid :- HID] Returns: s/Bool
Returns true iff an HID is a leaf and has the :value attribute
Inputs: [hid :- HID] Returns: s/Bool Returns true iff an HID is a leaf and has the :value attribute
(new-forest)
Returns a new, empty forest.
Returns a new, empty forest.
(new-hid)
Inputs: [] Returns: HID
Returns a new HexID
Inputs: [] Returns: HID Returns a new HexID
(node-hid? hid)
Inputs: [hid :- HID]
Returns true iff an HID is a Node
Inputs: [hid :- HID] Returns true iff an HID is a Node
(raw-kids-node? node)
Inputs: [node :- tsk/KeyMap] Returns: s/Bool
Returns true if all of a node's kids are raw leaf nodes.
Inputs: [node :- tsk/KeyMap] Returns: s/Bool Returns true if all of a node's kids are raw leaf nodes.
(raw-leaf-node? node)
Inputs: [node :- tsk/KeyMap] Returns: s/Bool
Returns true if a node is a leaf with {:tag ::raw}.
Inputs: [node :- tsk/KeyMap] Returns: s/Bool Returns true if a node is a leaf with {:tag ::raw}.
(remove-all-kids hid)
Inputs: [hid :- HID] Returns: tsk/KeyMap
Removes all children from a Node.
Inputs: [hid :- HID] Returns: tsk/KeyMap Removes all children from a Node.
(remove-hid & hids-leaving)
Inputs: [& hids-leaving :- [HID]] Returns: #{HID}
Removes one or more nodes and all references to them from the database. May create orphaned nodes.
Inputs: [& hids-leaving :- [HID]] Returns: #{HID} Removes one or more nodes and all references to them from the database. May create orphaned nodes.
(remove-kids hid kids-leaving)
(remove-kids hid kids-leaving missing-kids-ok?)
Inputs: ([hid :- HID kids-leaving :- (s/either [HID] #{HID})] [hid :- HID kids-leaving :- (s/either [HID] #{HID}) missing-kids-ok? :- s/Bool]) Returns: tsk/KeyMap
Removes a set of children from a Node (including any duplcates).
Inputs: ([hid :- HID kids-leaving :- (s/either [HID] #{HID})] [hid :- HID kids-leaving :- (s/either [HID] #{HID}) missing-kids-ok? :- s/Bool]) Returns: tsk/KeyMap Removes a set of children from a Node (including any duplcates).
(remove-whitespace-leaves)
Removes leaves from all trees in the forest that are whitespace-only strings (including zero-length strings).
Removes leaves from all trees in the forest that are whitespace-only strings (including zero-length strings).
(root-hids)
Inputs: [] Returns: #{HID}
Return a vector of all root HID's
Inputs: [] Returns: #{HID} Return a vector of all root HID's
(set-node hid node)
(set-node hid attrs kids)
Inputs: ([hid :- HID node :- Node] [hid :- HID attrs :- tsk/KeyMap kids :- [HID]])
Unconditionally sets the value of a Node in the forest
Inputs: ([hid :- HID node :- Node] [hid :- HID attrs :- tsk/KeyMap kids :- [HID]]) Unconditionally sets the value of a Node in the forest
(tree->bush tree-node)
Inputs: [tree-node :- tsk/Map] Returns: tsk/Vec
Inputs: [tree-node :- tsk/Map] Returns: tsk/Vec
(tree->edn node)
Converts a tree to an EDN data structure
Converts a tree to an EDN data structure
(tree->enlive tree-node)
Inputs: [tree-node :- tsk/KeyMap] Returns: (s/either tsk/KeyMap tsk/Vec)
Inputs: [tree-node :- tsk/KeyMap] Returns: (s/either tsk/KeyMap tsk/Vec)
(tree->hiccup arg)
Inputs: [arg :- tsk/KeyMap] Returns: tsk/Vec
Converts a Tree to a Hiccup-format data structure.
Inputs: [arg :- tsk/KeyMap] Returns: tsk/Vec Converts a Tree to a Hiccup-format data structure.
(tree-leaf? arg)
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool
Returns true if the arg is a leaf node (no kids).
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool Returns true if the arg is a leaf node (no kids).
(tree-node? arg)
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool
Returns true if the arg is a legal tree node
Inputs: [arg :- tsk/KeyMap] Returns: s/Bool Returns true if the arg is a legal tree node
(validate-attrs attrs)
Inputs: [attrs :- tsk/KeyMap]
Inputs: [attrs :- tsk/KeyMap]
(validate-hid hid)
Inputs: [hid :- HID]
Returns HID arg iff it exists in the forest, else throws.
Inputs: [hid :- HID] Returns HID arg iff it exists in the forest, else throws.
(value-set hid value-new)
Inputs: [hid :- HID value-new :- s/Any] Returns: Node
Resets the value of a leaf
Inputs: [hid :- HID value-new :- s/Any] Returns: Node Resets the value of a leaf
(value-update hid fn-update-value & fn-update-value-args)
Inputs: [hid :- HID fn-update-value & fn-update-value-args] Returns: Node
Given a leaf with a value, updates that value using a function
Inputs: [hid :- HID fn-update-value & fn-update-value-args] Returns: Node Given a leaf with a value, updates that value using a function
(whitespace-leaf-hid? hid)
Inputs: [hid :- HID] Returns: s/Bool
Inputs: [hid :- HID] Returns: s/Bool
(xml->enlive xml-str)
Inputs: [xml-str :- s/Str] Returns: tsk/KeyMap
Inputs: [xml-str :- s/Str] Returns: tsk/KeyMap
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close