(add-to-parent items item)
Recursively scans items
, which can be multiple levels deep,
and tries to find a home for item
according to its parent ID.
Recursively scans `items`, which can be multiple levels deep, and tries to find a home for `item` according to its parent ID.
(compose-item-tree block)
Given a block
, composes a data representation of it based on
the indentation of each line.
Given a `block`, composes a data representation of it based on the indentation of each line.
(compose-items-with-indent-guides block)
Composes a vector of maps from given block
that adds a unique
ID to each line as well as its indent-n
which is used later
on to determine hierarchies.
Composes a vector of maps from given `block` that adds a unique ID to each line as well as its `indent-n` which is used later on to determine hierarchies.
(compose-items-with-parents block)
Composes a 1-level list of items from block
and adds parent
information to each if they belong to another item. The result
of this is used to build the final data tree.
Composes a 1-level list of items from `block` and adds parent information to each if they belong to another item. The result of this is used to build the final data tree.
(find-parent-id items index)
Assuming a 1-level items
, will attempt to find the parent id
of the item at given index
. Will return nil
otherwise.
Assuming a 1-level `items`, will attempt to find the parent `id` of the item at given `index`. Will return `nil` otherwise.
(is? block)
Determines whether we're dealing with a list block or not.
Determines whether we're dealing with a list block or not.
(render-items items)
Renders an ordered/un-ordered list hierarchy from given items
.
Renders an ordered/un-ordered list hierarchy from given `items`.
(string->indent-n str)
Returns the indentation count from left of str
, which must be
in spaces and not tabs.
Returns the indentation count from left of `str`, which must be in spaces and not tabs.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close