code.doc.collect.base
collect-article-metas
added in 3.0
(collect-article-metas {:keys [articles], :as interim} name)shunts :article directives into a separate :meta section
(collect-article-metas {:articles {“example” {:elements {:type :article :options {:color :light}}}}} “example”) => ’{:articles {“example” {:elements [] :meta {:options {:color :light}}}}}
collect-citations
added in 3.0
(collect-citations {:keys [articles], :as interim} name)shunts :citation directives into a separate :citation section
(collect-citations {:articles {“example” {:elements {:type :citation :author “Chris”}}}} “example”) => {:articles {“example” {:elements [], :citations {:type :citation, :author “Chris”}}}}
collect-global-metas
added in 3.0
(collect-global-metas {:keys [articles], :as interim} name)shunts :global directives into a globally available :meta section
(collect-global-metas {:articles {“example” {:elements {:type :global :options {:color :light}}}}} “example”) => {:articles {“example” {:elements ()}} :global {:options {:color :light}}}
collect-namespaces
added in 3.0
(collect-namespaces {:keys [articles], :as interim} 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 () :meta {}}} :namespaces {clojure.core {:type :ns-form :ns clojure.core}}}
collect-tags
added in 3.0
(collect-tags {:keys [articles], :as interim} name)puts any element with :tag attribute into a separate :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”}}}}