code.framework.docstring

->docstring

added in 3.0

(->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’”

->docstring-node

added in 3.0

(->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 ’”

->docstring-tag

added in 3.0

(->docstring-tag block)

converts a string representation of block

(->docstring-tag (block/block \c)) => “‘c’”

->refstring

added in 3.0

(->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”

append-node

added in 3.0

(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)”

insert-docstring

added in 3.0

(insert-docstring nav nsp gathered)

inserts the meta information and docstring from tests

strip-quotes

added in 3.0

(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"”