Liking cljdoc? Tell your friends :D

hydrox.doc.link.tags


create-candidateclj

(create-candidate {:keys [origin title type] :as element})

creates a candidate tag from a variety of sources

(create-candidate {:origin :ns :ns 'clojure.core}) => "ns-clojure-core"

(create-candidate {:title "hello again"}) => "hello-again"

(create-candidate {:type :image :src "http://github.com/hello/gather.jpeg"}) => "img-http----github-com--hello--gather-jpeg"

creates a candidate tag from a variety of sources

(create-candidate {:origin :ns :ns 'clojure.core})
=> "ns-clojure-core"

(create-candidate {:title "hello again"})
=> "hello-again"

(create-candidate {:type :image :src "http://github.com/hello/gather.jpeg"})
=> "img-http----github-com--hello--gather-jpeg"
sourceraw docstring

create-tagclj

(create-tag element tags)
(create-tag element tags candidate)

creates a tag from an element

(let [tags (atom #{}) result (create-tag {:title "hello"} tags)] [@tags result]) => [#{"hello"} {:title "hello", :tag "hello"}]

(let [tags (atom #{"hello"}) result (create-tag {:title "hello"} tags)] [@tags result]) => [#{"hello" "hello-0"} {:title "hello", :tag "hello-0"}]

creates a tag from an element

(let [tags (atom #{})
      result (create-tag {:title "hello"} tags)]
  [@tags result])
=> [#{"hello"} {:title "hello", :tag "hello"}]

(let [tags (atom #{"hello"})
      result (create-tag {:title "hello"} tags)]
  [@tags result])
=> [#{"hello" "hello-0"} {:title "hello", :tag "hello-0"}]
sourceraw docstring

inc-candidateclj

(inc-candidate candidate)

creates an incremental version of a name

(inc-candidate "hello") => "hello-0" (inc-candidate "hello-1") => "hello-2"

creates an incremental version of a name

(inc-candidate "hello") => "hello-0"
(inc-candidate "hello-1") => "hello-2"
sourceraw docstring

(link-tags {:keys [articles] :as folio} name)

creates a tag for elements within the article (-> {:articles {"example" {:elements [{:type :chapter :title "hello world"} {:type :chapter :title "hello world"}]}}} (collect/collect-tags "example") (link-tags "example")) => {:articles {"example" {:elements [{:type :chapter, :title "hello world", :tag "hello-world"} {:type :chapter, :title "hello world", :tag "hello-world-0"}], :tags #{}}}}

creates a tag for elements within the article
(-> {:articles {"example" {:elements [{:type :chapter :title "hello world"}
                                      {:type :chapter :title "hello world"}]}}}
    (collect/collect-tags "example")
    (link-tags "example"))
=> {:articles
    {"example"
     {:elements [{:type :chapter, :title "hello world", :tag "hello-world"}
                {:type :chapter, :title "hello world", :tag "hello-world-0"}],
      :tags #{}}}}
sourceraw docstring

tag-optional?clj

source

tag-required?clj

source

tag-stringclj

(tag-string s)

creates a string that can be used as an anchor

(tag-string "hello.world/again") => "hello-world--again"

creates a string that can be used as an anchor

(tag-string "hello.world/again")
=> "hello-world--again"
sourceraw docstring

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

× close