Liking cljdoc? Tell your friends :D

hydrox.meta.util


all-filesclj

(all-files project path-type extension)

finds all files in the project given a context

(->> (all-files {:root (.getCanonicalPath (io/file "example"))} :root "md") (map #(.getName %))) => ["README.md"]

finds all files in the project given a context

(->> (all-files {:root (.getCanonicalPath (io/file "example"))} :root "md")
     (map #(.getName %)))
=> ["README.md"]
sourceraw docstring

append-nodeclj

(append-node zloc node)

Adds node as well as whitespace and newline on right

(-> (z/of-string "(+)") (z/down) (append-node 2) (append-node 1) (z/->root-string)) => "(+\n 1\n 2)"

Adds node as well as whitespace and newline on right

(-> (z/of-string "(+)")
    (z/down)
    (append-node 2)
    (append-node 1)
    (z/->root-string))
=> "(+\n  1\n  2)"
sourceraw docstring

escape-escapesclj

(escape-escapes s)

makes sure that newlines are printable

(escape-escapes "
") => "
"

makes sure that newlines are printable
 
   (escape-escapes "\
")
   => "\
"
sourceraw docstring

escape-newlinesclj

(escape-newlines s)

makes sure that newlines are printable

(escape-newlines "
") => "\n"

makes sure that newlines are printable
 
   (escape-newlines "\
")
   => "\n"
sourceraw docstring

escape-quotesclj

(escape-quotes s)

makes sure that quotes are printable in string form

(escape-quotes ""hello"") => ""hello""

makes sure that quotes are printable in string form

(escape-quotes "\"hello\"")
=> "\"hello\""
sourceraw docstring

has-quotes?clj

(has-quotes? s)

checks if a string has quotes

(has-quotes? ""hello"") => true

checks if a string has quotes

(has-quotes? "\"hello\"")
=> true
sourceraw docstring

import-locationclj

(import-location zloc nsp gathered)

imports the meta information and docstring

imports the meta information and docstring
sourceraw docstring

nodes->docstringclj

(nodes->docstring nodes)

converts nodes to a docstring compatible (->> (z/of-string ""hello"\n (+ 1 2)\n => 3 ") (iterate z/right*) (take-while identity) (map z/node) (nodes->docstring) (node/string)) => ""hello\n (+ 1 2)\n => 3 ""

(->> (z/of-string (str [\e \d])) (iterate z/right*) (take-while identity) (map z/node) (nodes->docstring) (str) (read-string)) => "[\e \d]"

converts nodes to a docstring compatible
 (->> (z/of-string "\"hello\"\n  (+ 1 2)\n => 3 ")
      (iterate z/right*)
      (take-while identity)
      (map z/node)
      (nodes->docstring)
      (node/string))
 => ""hello\n  (+ 1 2)\n  => 3 ""

 (->> (z/of-string (str [\e \d]))
      (iterate z/right*)
      (take-while identity)
      (map z/node)
      (nodes->docstring)
      (str)
      (read-string))
=> "[\e \d]"
sourceraw docstring

strip-quotesclj

(strip-quotes s)

gets rid of quotes in a string

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

gets rid of quotes in a string

(strip-quotes "\"hello\"")
=> "hello"
sourceraw docstring

strip-quotes-arrayclj

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

utility that strips quotes when not the result of a fact (strip-quotes-array [""hello""]) => ["hello"]

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

utility that strips quotes when not the result of a fact
(strip-quotes-array ["\"hello\""])
=> ["hello"]

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

write-to-fileclj

(write-to-file zloc file)

exports the zipper contents to file

exports the zipper contents to file
sourceraw docstring

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

× close