Liking cljdoc? Tell your friends :D

hara.lib.jsoup


generateclj

(generate elem)

generates string html for element

(generate (tree->node [:body [:div "hello"] "world"])) => "<body>\n <div>hello</div>world\n</body>"

generates string html for element

(generate (tree->node [:body [:div "hello"] "world"]))
=> "<body>\n    <div>hello</div>world\n</body>"
raw docstring

htmlclj

(html rep)

converts either node or tree representation to a html string

(html [:body [:div "hello"] "world"]) => "<body>\n <div>hello</div>world\n</body>"

converts either node or tree representation to a html string

(html [:body [:div "hello"] "world"])
=> "<body>\n    <div>hello</div>world\n</body>"
raw docstring

nodeclj

(node rep)

converts either a string or tree representation to a Jsoup node

(node [:body [:div "hello"] "world"]) => org.jsoup.nodes.Element

converts either a string or tree representation to a Jsoup node

(node [:body [:div "hello"] "world"])
=> org.jsoup.nodes.Element
raw docstring

node->treecljmultimethod

converts a Jsoup node to tree

(-> (parse "<body><div>hello</div>world</body>") (node->tree)) => [:body [:div "hello"] "world"]

converts a Jsoup node to tree

(-> (parse "<body><div>hello</div>world</body>")
    (node->tree))
=> [:body [:div "hello"] "world"]
raw docstring

parseclj

(parse s)

reads a Jsoup node from string

(parse "<body><div>hello</div>world</body>") => org.jsoup.nodes.Element

reads a Jsoup node from string

(parse "<body><div>hello</div>world</body>")
=> org.jsoup.nodes.Element
raw docstring

tightenclj

(tighten html)

removes lines for elements that contain no internal elements

(tighten "<b>\nhello\n</b>") => "<b>hello</b>"

removes lines for elements that contain no internal elements

(tighten "<b>\nhello\n</b>")
=> "<b>hello</b>"
raw docstring

treeclj

(tree rep)

converts either a string or node representation into a tree

(tree +content+) => [:html {:id "3"} [:head [:title "First parse"]] [:body [:p "Parsed HTML into a doc."]]]

converts either a string or node representation into a tree

(tree +content+)
=> [:html {:id "3"}
    [:head [:title "First parse"]]
    [:body [:p "Parsed HTML into a doc."]]]
raw docstring

tree->nodeclj

(tree->node rep)

converts a tree to a Jsoup node

(tree->node [:body [:div "hello"] "world"]) => org.jsoup.nodes.Element

converts a tree to a Jsoup node

(tree->node [:body [:div "hello"] "world"])
=> org.jsoup.nodes.Element
raw docstring

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

× close