(containify v)(containify v [tag & more])makes a nested vector object from a sequence of elements (containify [{:type :generic} {:type :paragraph} {:type :chapter} {:type :paragraph} {:type :section} {:type :paragraph} {:type :subsection} {:type :paragraph} {:type :section} {:type :chapter} {:type :section} {:type :appendix}]) => [{:type :article} [{:type :generic} [{:type :paragraph}]] [{:type :chapter} [{:type :paragraph}] [{:type :section} [{:type :paragraph}] [{:type :subsection} [{:type :paragraph}]]] [{:type :section}]] [{:type :chapter} [{:type :section}]] [{:type :appendix}]]
makes a nested vector object from a sequence of elements
(containify [{:type :generic}
{:type :paragraph}
{:type :chapter}
{:type :paragraph}
{:type :section}
{:type :paragraph}
{:type :subsection}
{:type :paragraph}
{:type :section}
{:type :chapter}
{:type :section}
{:type :appendix}])
=> [{:type :article}
[{:type :generic}
[{:type :paragraph}]]
[{:type :chapter}
[{:type :paragraph}]
[{:type :section}
[{:type :paragraph}]
[{:type :subsection}
[{:type :paragraph}]]]
[{:type :section}]]
[{:type :chapter}
[{:type :section}]]
[{:type :appendix}]](inclusive x y)determines which sections are contained by the other (inclusive :article :section) => true
(inclusive :chapter :subsection) => true
(inclusive :chapter :chapter) => false
(inclusive :section :chapter) => false
determines which sections are contained by the other (inclusive :article :section) => true (inclusive :chapter :subsection) => true (inclusive :chapter :chapter) => false (inclusive :section :chapter) => false
(seperate f v)(seperate f [ele & more] all current)groups elements in an array (seperate #(= 1 %) [1 2 2 1 3 4 5]) => [[1 2 2] [1 3 4 5]]
groups elements in an array (seperate #(= 1 %) [1 2 2 1 3 4 5]) => [[1 2 2] [1 3 4 5]]
(structure v)creates a nested map structure of elements and their containers (structure [{:type :generic} {:type :paragraph} {:type :chapter} {:type :paragraph} {:type :section} {:type :paragraph} {:type :subsection} {:type :paragraph} {:type :section} {:type :chapter} {:type :section} {:type :appendix}]) => {:type :article, :elements [{:type :generic, :elements [{:type :paragraph}]} {:type :chapter, :elements [{:type :paragraph} {:type :section, :elements [{:type :paragraph} {:type :subsection, :elements [{:type :paragraph}]}]} {:type :section, :elements []}]} {:type :chapter, :elements [{:type :section, :elements []}]} {:type :appendix, :elements []}]}
creates a nested map structure of elements and their containers
(structure [{:type :generic}
{:type :paragraph}
{:type :chapter}
{:type :paragraph}
{:type :section}
{:type :paragraph}
{:type :subsection}
{:type :paragraph}
{:type :section}
{:type :chapter}
{:type :section}
{:type :appendix}])
=> {:type :article,
:elements [{:type :generic,
:elements [{:type :paragraph}]}
{:type :chapter,
:elements [{:type :paragraph}
{:type :section,
:elements [{:type :paragraph}
{:type :subsection,
:elements [{:type :paragraph}]}]}
{:type :section,
:elements []}]}
{:type :chapter,
:elements [{:type :section, :elements []}]}
{:type :appendix, :elements []}]}cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |