(link-anchors {:keys [anchors-lu articles] :as folio} name)
creates a global anchors list based on the lookup
(-> {:articles {"example" {:elements [{:type :chapter :tag "hello" :number "1"}]}}} (link-anchors-lu "example") (link-anchors "example") :anchors) => {"example" {"hello" {:type :chapter, :tag "hello", :number "1"}}}
creates a global anchors list based on the lookup (-> {:articles {"example" {:elements [{:type :chapter :tag "hello" :number "1"}]}}} (link-anchors-lu "example") (link-anchors "example") :anchors) => {"example" {"hello" {:type :chapter, :tag "hello", :number "1"}}}
(link-anchors-lu {:keys [articles] :as folio} name)
creates the anchor lookup for tags and numbers (-> {:articles {"example" {:elements [{:type :chapter :tag "hello" :number "1"}]}}} (link-anchors-lu "example") :anchors-lu) => {"example" {:by-number {:chapter {"1" {:type :chapter, :tag "hello", :number "1"}}}, :by-tag {"hello" {:type :chapter, :tag "hello", :number "1"}}}}
creates the anchor lookup for tags and numbers (-> {:articles {"example" {:elements [{:type :chapter :tag "hello" :number "1"}]}}} (link-anchors-lu "example") :anchors-lu) => {"example" {:by-number {:chapter {"1" {:type :chapter, :tag "hello", :number "1"}}}, :by-tag {"hello" {:type :chapter, :tag "hello", :number "1"}}}}
(link-namespaces {:keys [namespaces articles] :as folio} name)
link elements with :ns
forms to code
(link-namespaces {:articles {"example" {:elements [{:type :ns :ns "clojure.core"}]}} :namespaces {"clojure.core" {:code "(ns clojure.core)"}}} "example") => {:articles {"example" {:elements [{:type :code :ns "clojure.core" :origin :ns :indentation 0 :code "(ns clojure.core)"}]}} :namespaces {"clojure.core" {:code "(ns clojure.core)"}}}
link elements with `:ns` forms to code (link-namespaces {:articles {"example" {:elements [{:type :ns :ns "clojure.core"}]}} :namespaces {"clojure.core" {:code "(ns clojure.core)"}}} "example") => {:articles {"example" {:elements [{:type :code :ns "clojure.core" :origin :ns :indentation 0 :code "(ns clojure.core)"}]}} :namespaces {"clojure.core" {:code "(ns clojure.core)"}}}
(link-numbers folio name)
creates numbers for main sections, images, code and equations (link-numbers {:articles {"example" {:elements [{:type :chapter :title "hello"} {:type :section :title "world"}]}}} "example") {:articles {"example" {:elements [{:type :chapter, :title "hello", :number "1"} {:type :section, :title "world", :number "1.1"}]}}}
creates numbers for main sections, images, code and equations (link-numbers {:articles {"example" {:elements [{:type :chapter :title "hello"} {:type :section :title "world"}]}}} "example") {:articles {"example" {:elements [{:type :chapter, :title "hello", :number "1"} {:type :section, :title "world", :number "1.1"}]}}}
(link-references {:keys [references] :as folio} name)
link code for elements to references
(link-references {:articles {"example" {:elements [{:type :reference :refer 'example.core/hello}]}} :references '{example.core {hello {:docs [] :source "(defn hello [] 1)"}}}} "example") => {:articles {"example" {:elements '[{:type :code, :refer example.core/hello, :origin :reference, :indentation 0, :code "(defn hello [] 1)", :mode :source, :title "source of <i>example.core/hello</i>"}]}}, :references '{example.core {hello {:docs [], :source "(defn hello [] 1)"}}}}
link code for elements to references (link-references {:articles {"example" {:elements [{:type :reference :refer 'example.core/hello}]}} :references '{example.core {hello {:docs [] :source "(defn hello [] 1)"}}}} "example") => {:articles {"example" {:elements '[{:type :code, :refer example.core/hello, :origin :reference, :indentation 0, :code "(defn hello [] 1)", :mode :source, :title "source of <i>example.core/hello</i>"}]}}, :references '{example.core {hello {:docs [], :source "(defn hello [] 1)"}}}}
(link-stencil folio name)
links extra information for using the stencil format (link-stencil {:articles {"example" {:meta {:name "world"} :elements [{:type :paragraph :text "{{PROJECT.version}} {{DOCUMENT.name}}"} {:type :paragraph :text "{{hello}} {{example.hello.label}}"}]}} :project {:version "0.1"} :anchors {"example" {"hello" {:number 2 :label "two"}}}} "example") => {:articles {"example" {:meta {:name "world"}, :elements [{:type :paragraph, :text "0.1 world"} {:type :paragraph, :text "2 two"}]}}, :project {:version "0.1"}, :anchors {"example" {"hello" {:number 2, :label "two"}}}}
links extra information for using the stencil format (link-stencil {:articles {"example" {:meta {:name "world"} :elements [{:type :paragraph :text "{{PROJECT.version}} {{DOCUMENT.name}}"} {:type :paragraph :text "{{hello}} {{example.hello.label}}"}]}} :project {:version "0.1"} :anchors {"example" {"hello" {:number 2 :label "two"}}}} "example") => {:articles {"example" {:meta {:name "world"}, :elements [{:type :paragraph, :text "0.1 world"} {:type :paragraph, :text "2 two"}]}}, :project {:version "0.1"}, :anchors {"example" {"hello" {:number 2, :label "two"}}}}
(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 #{}}}}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close