Liking cljdoc? Tell your friends :D

hydrox.doc.collect


collect-articleclj

(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}}}}}
sourceraw docstring

collect-citationsclj

(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"}]}}}
sourceraw docstring

collect-globalclj

(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}}}
sourceraw docstring

collect-namespacesclj

(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}}}
sourceraw docstring

collect-tagsclj

(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"}}}}
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close