Liking cljdoc? Tell your friends :D

hara.code.framework.docstring


->docstringclj

(->docstring nodes)

converts nodes to a docstring

(->> (nav/parse-root "\n (+ 1 2)\n => 3") (nav/down) (iterate zip/step-right) (take-while zip/get) (map zip/get) (->docstring)) => "\n (+ 1 2)\n => 3"

(->docstring [(block/block \e)]) => "'e'"

converts nodes to a docstring

(->> (nav/parse-root "\n  (+ 1 2)\n => 3")
     (nav/down)
     (iterate zip/step-right)
     (take-while zip/get)
     (map zip/get)
     (->docstring))
=> "\n  (+ 1 2)\n => 3"

(->docstring [(block/block \e)])
=> "'e'"
raw docstring

->docstring-nodeclj

(->docstring-node intro nodes)

converts nodes to a docstring node

(->> (nav/navigator [\e \d \newline]) (zip/step-inside) (iterate zip/step-right) (take-while zip/get) (map zip/get) (->docstring-node "") (block/value)) => "'e' 'd' '\n '"

converts nodes to a docstring node

(->> (nav/navigator [\e \d \newline])
     (zip/step-inside)
     (iterate zip/step-right)
     (take-while zip/get)
     (map zip/get)
     (->docstring-node "")
     (block/value))
=> "'e' 'd' '\n '"
raw docstring

->docstring-tagclj

(->docstring-tag block)

converts a string representation of block

(->docstring-tag (block/block \c)) => "'c'"

converts a string representation of block

(->docstring-tag (block/block \c))
=> "'c'"
raw docstring

->refstringclj

(->refstring docs)

creates a refstring for use in html blocks

(->> (nav/parse-root ""hello"\n (+ 1 2)\n => 3") (iterate zip/step-right) (take-while zip/get) (map zip/get) (->refstring)) => ""hello"\n (+ 1 2)\n => 3"

creates a refstring for use in html blocks

(->> (nav/parse-root "\"hello\"\n  (+ 1 2)\n => 3")
     (iterate zip/step-right)
     (take-while zip/get)
     (map zip/get)
     (->refstring))
=> "\"hello\"\n  (+ 1 2)\n => 3"
raw docstring

append-nodeclj

(append-node nav node)

Adds node as well as whitespace and newline on right

(-> (nav/parse-string "(+)") (zip/step-inside) (append-node 2) (append-node 1) (nav/root-string)) => "(+\n 1\n 2)"

Adds node as well as whitespace and newline on right

(-> (nav/parse-string "(+)")
    (zip/step-inside)
    (append-node 2)
    (append-node 1)
    (nav/root-string))
=> "(+\n  1\n  2)"
raw docstring

insert-docstringclj

(insert-docstring nav nsp gathered)

inserts the meta information and docstring from tests

inserts the meta information and docstring from tests
raw docstring

strip-quotesclj

(strip-quotes arr)
(strip-quotes [x & more] p1 p2 out)

utility that strips quotes when not the result of a fact

(strip-quotes [""hello""]) => ["hello"]

(strip-quotes ["(str "hello")" " " "=>" " " ""hello""]) => ["(str "hello")" " " "=>" " " ""hello""]

utility that strips quotes when not the result of a fact

(strip-quotes ["\"hello\""])
=> ["hello"]

(strip-quotes ["(str \"hello\")" " " "=>" " " "\"hello\""])
=> ["(str \"hello\")" " " "=>" " " "\"hello\""]
raw docstring

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

× close