std.html

generate

added in 3.0

(generate elem)

generates string html for element

(generate (tree->node [:body :div “hello” “world”])) => “\n

hello
world\n”

html

added in 3.0

(html rep)

converts either node or tree representation to a html string

(html [:body :div “hello” “world”]) => “\n

hello
world\n”

html-inline

added in 4.0

(html-inline rep)

emits body with no newline

(html-inline [:body :div “hello” “world”]) => “

hello
world”

inline

added in 4.0

(inline html)

emits function without any newlines

(inline (html [:body :div “hello” “world”])) => “

hello
world”

IText

protocol

members

text

(text _)

node

added in 3.0

(node rep)

converts either a string or tree representation to a Jsoup node

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

node->tree

multimethod

added in 3.0

converts a Jsoup node to tree

(-> (parse “

hello
world”) (node->tree)) => [:body :div “hello” “world”]

parse

added in 3.0

(parse s)

reads a Jsoup node from string

(parse “

hello
world”) => org.jsoup.nodes.Element

select

added in 3.0

(select node query)

applies css selector to node

select-first

added in 3.0

(select-first node query)

gets the first match given selector and node

tighten

added in 3.0

(tighten html)

removes lines for elements that contain no internal elements

(tighten “\nhello\n”) => “hello

tree

added in 3.0

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

tree->node

added in 3.0

(tree->node rep)

converts a tree to a Jsoup node

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