Liking cljdoc? Tell your friends :D

hara.code.framework.test.fact


gather-factclj

(gather-fact nav)

Make docstring notation out of fact form (-> "^{:refer example/hello-world :added "0.1"} (fact "Sample test program"\n (+ 1 1) => 2\n (long? 3) => true)" (nav/parse-string) nav/down nav/right nav/down nav/right (gather-fact) (update-in [:test] docstring/->docstring)) => (just-in {:form 'fact :ns 'example, :var 'hello-world, :refer 'example/hello-world :added "0.1", :line {:row 2, :col 8, :end-row 4, :end-col 21} :intro "Sample test program", :test "\n (+ 1 1) => 2\n (long? 3) => true"})

Make docstring notation out of fact form
(-> "^{:refer example/hello-world :added \"0.1\"}
     (fact \"Sample test program\"\n  (+ 1 1) => 2\n  (long? 3) => true)"
    (nav/parse-string)
    nav/down nav/right nav/down nav/right
    (gather-fact)
    (update-in [:test] docstring/->docstring))
=> (just-in {:form  'fact
             :ns    'example,
            :var   'hello-world,
             :refer 'example/hello-world
             :added "0.1",
             :line  {:row 2, :col 8, :end-row 4, :end-col 21}
             :intro "Sample test program",
             :test  "\n  (+ 1 1) => 2\n  (long? 3) => true"})
raw docstring

gather-fact-bodyclj

(gather-fact-body nav)
(gather-fact-body nav output)

helper function for gather-fact (-> "(\n (+ 1 1) => 2\n (long? 3) => true)" nav/parse-string nav/down (gather-fact-body) (docstring/->docstring)) => "\n (+ 1 1) => 2\n (long? 3) => true"

helper function for `gather-fact`
(-> "(\n  (+ 1 1) => 2\n  (long? 3) => true)"
    nav/parse-string
    nav/down
    (gather-fact-body)
    (docstring/->docstring))
=> "\n  (+ 1 1) => 2\n  (long? 3) => true"
raw docstring

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

× close