(collect-article {:keys [articles] :as folio} name)shunts :article directives into a seperate :meta section
(collect-article {:articles {"example" {:elements [{:type :article :options {:color :light}}]}}} "example") => '{:articles {"example" {:elements [] :meta {:options {:color :light}}}}}
shunts `:article` directives into a seperate `:meta` section
(collect-article
{:articles {"example" {:elements [{:type :article
:options {:color :light}}]}}}
"example")
=> '{:articles {"example" {:elements []
:meta {:options {:color :light}}}}}(collect-citations {:keys [articles] :as folio} name)shunts :citation directives into a seperate :citation section
(collect-citations {:articles {"example" {:elements [{:type :citation :author "Chris"}]}}} "example") => {:articles {"example" {:elements [], :citations [{:type :citation, :author "Chris"}]}}}
shunts `:citation` directives into a seperate `:citation` section
(collect-citations
{:articles {"example" {:elements [{:type :citation :author "Chris"}]}}}
"example")
=> {:articles {"example" {:elements [],
:citations [{:type :citation, :author "Chris"}]}}}(collect-global {:keys [articles] :as folio} name)shunts :global directives into a globally available :meta section
(collect-global {:articles {"example" {:elements [{:type :global :options {:color :light}}]}}} "example") => {:articles {"example" {:elements ()}} :meta {:options {:color :light}}}
shunts `:global` directives into a globally available `:meta` section
(collect-global
{:articles {"example" {:elements [{:type :global
:options {:color :light}}]}}}
"example")
=> {:articles {"example" {:elements ()}}
:meta {:options {:color :light}}}(collect-namespaces {:keys [articles] :as folio} name)combines :ns-form directives into a namespace map for easy referral
(collect-namespaces {:articles {"example" {:elements [{:type :ns-form :ns 'clojure.core}]}}} "example") => '{:articles {"example" {:elements ()}} :namespaces {clojure.core {:type :ns-form :ns clojure.core}}}
combines `:ns-form` directives into a namespace map for easy referral
(collect-namespaces
{:articles {"example" {:elements [{:type :ns-form
:ns 'clojure.core}]}}}
"example")
=> '{:articles {"example" {:elements ()}}
:namespaces {clojure.core {:type :ns-form :ns clojure.core}}}(collect-tags {:keys [articles] :as folio} name)puts any element with :tag attribute into a seperate :tag set
(collect-tags {:articles {"example" {:elements [{:type :chapter :tag "hello"} {:type :chapter :tag "world"}]}}} "example") => {:articles {"example" {:elements [{:type :chapter :tag "hello"} {:type :chapter :tag "world"}] :tags #{"hello" "world"}}}}
puts any element with `:tag` attribute into a seperate `:tag` set
(collect-tags
{:articles {"example" {:elements [{:type :chapter :tag "hello"}
{:type :chapter :tag "world"}]}}}
"example")
=> {:articles {"example" {:elements [{:type :chapter :tag "hello"}
{:type :chapter :tag "world"}]
:tags #{"hello" "world"}}}}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 |