enlive-html is a selector-based transformation and extraction engine.
enlive-html is a selector-based transformation and extraction engine.
(add-class & classes)
Adds the specified classes to the selected element.
Adds the specified classes to the selected element.
(after & values)
Inserts the values after the current selection (node or fragment).
Inserts the values after the current selection (node or fragment).
(alter-ns-options! f & args)
Sets the default options to use by all templates and snippets in the declaring ns.
Sets the default options to use by all templates and snippets in the declaring ns.
(append & values)
Appends the values to the content of the selected element.
Appends the values to the content of the selected element.
(append! t)
(append! t a)
(append! t a b)
(append! t a b c)
(append! t a b c d)
(append! t a b c d e)
(append! t a b c d e f)
(append! t a b c d e f g)
(append! t a b c d e f g & more)
Selector predicate, tests if the specified attributes contain the specified values. See CSS *= .
Selector predicate, tests if the specified attributes contain the specified values. See CSS *= .
Selector predicate, tests if the specified attributes end with the specified values. See CSS $= .
Selector predicate, tests if the specified attributes end with the specified values. See CSS $= .
(attr-has attr & values)
Selector predicate, tests if the specified whitespace-seperated attribute contains the specified values. See CSS ~=
Selector predicate, tests if the specified whitespace-seperated attribute contains the specified values. See CSS ~=
Selector predicate, tests if the specified attributes start with the specified values. See CSS ^= .
Selector predicate, tests if the specified attributes start with the specified values. See CSS ^= .
(attr-values node attr)
Returns the whitespace-separated values of the specified attr as a set or nil.
Returns the whitespace-separated values of the specified attr as a set or nil.
Selector predicate, tests if the specified attributes have the specified values.
Selector predicate, tests if the specified attributes have the specified values.
(attr? & kws)
Selector predicate, tests if the specified attributes are present.
Selector predicate, tests if the specified attributes are present.
Selector predicate, tests if the specified attributes start with the specified values. See CSS |= .
Selector predicate, tests if the specified attributes start with the specified values. See CSS |= .
(before & values)
Inserts the values before the current selection (node or fragment).
Inserts the values before the current selection (node or fragment).
(but selector-step)
Selector predicate, matches elements which are rejected by the specified selector-step. See CSS :not
Selector predicate, matches elements which are rejected by the specified selector-step. See CSS :not
(but-node selector-step)
Selector predicate, matches nodes which are rejected by the specified selector-step. See CSS :not
Selector predicate, matches nodes which are rejected by the specified selector-step. See CSS :not
(content & values)
Replaces the content of the element. Values can be nodes or collection of nodes.
Replaces the content of the element. Values can be nodes or collection of nodes.
(defsnippet name source selector args & forms)
Define a named snippet -- equivalent to (def name (snippet source selector args ...)).
Define a named snippet -- equivalent to (def name (snippet source selector args ...)).
(deftemplate name source args & forms)
Defines a template as a function that returns a seq of strings.
Defines a template as a function that returns a seq of strings.
(do-> & fns)
Chains (composes) several transformations. Applies functions from left to right.
Chains (composes) several transformations. Applies functions from left to right.
(get-resource resource loader)
Loads a resource, using the specified loader. Returns a seq of nodes.
Loads a resource, using the specified loader. Returns a seq of nodes.
(has selector)
Selector predicate, matches elements which contain at least one element that matches the specified selector. See jQuery's :has
Selector predicate, matches elements which contain at least one element that matches the specified selector. See jQuery's :has
(has-class & classes)
Selector predicate, :.foo.bar is as short-hand for (has-class "foo" "bar").
Selector predicate, :.foo.bar is as short-hand for (has-class "foo" "bar").
(html & nodes-specs)
Allows to define inline fragments with a hiccup-like syntax.
Allows to define inline fragments with a hiccup-like syntax.
(html-content & values)
Replaces the content of the element. Values are strings containing html code.
Replaces the content of the element. Values are strings containing html code.
(html-resource resource)
(html-resource resource options)
Loads an HTML resource, returns a seq of nodes.
Loads an HTML resource, returns a seq of nodes.
(html-snippet & values)
Concatenate values as a string and then parse it with tagsoup. html-snippet doesn't insert missing <html> or <body> tags.
Concatenate values as a string and then parse it with tagsoup. html-snippet doesn't insert missing <html> or <body> tags.
(id= id)
Selector predicate, :#foo is as short-hand for (id= "foo").
Selector predicate, :#foo is as short-hand for (id= "foo").
(left selector-step)
Selector predicate, matches nodes whose immediate left sibling element is matched by the specified selector-step.
Selector predicate, matches nodes whose immediate left sibling element is matched by the specified selector-step.
(lefts selector-step)
Selector predicate, matches nodes whose one left sibling element is matched by the specified selector-step.
Selector predicate, matches nodes whose one left sibling element is matched by the specified selector-step.
(let-select nodes-or-fragments bindings & body)
For each node or fragment, performs a subselect and bind it to a local, then evaluates body. bindings is a vector of binding forms and selectors.
For each node or fragment, performs a subselect and bind it to a local, then evaluates body. bindings is a vector of binding forms and selectors.
(move src-selector dest-selector)
(move src-selector dest-selector combiner)
Takes all nodes (under the current element) matched by src-selector, removes them and combines them with the elements matched by dest-selector. By default, destination elements are replaced.
Takes all nodes (under the current element) matched by src-selector, removes them and combines them with the elements matched by dest-selector. By default, destination elements are replaced.
(nth-child b)
(nth-child a b)
Selector step, tests if the node has an+b-1 siblings on its left. See CSS :nth-child.
Selector step, tests if the node has an+b-1 siblings on its left. See CSS :nth-child.
(nth-last-child b)
(nth-last-child a b)
Selector step, tests if the node has an+b-1 siblings on its right. See CSS :nth-last-child.
Selector step, tests if the node has an+b-1 siblings on its right. See CSS :nth-last-child.
(nth-last-of-type b)
(nth-last-of-type a b)
Selector step, tests if the node has an+b-1 siblings of the same type (tag name) on its right. See CSS :nth-last-of-type.
Selector step, tests if the node has an+b-1 siblings of the same type (tag name) on its right. See CSS :nth-last-of-type.
(nth-of-type b)
(nth-of-type a b)
Selector step, tests if the node has an+b-1 siblings of the same type (tag name) on its left. See CSS :nth-of-type.
Selector step, tests if the node has an+b-1 siblings of the same type (tag name) on its left. See CSS :nth-of-type.
(pred f)
Turns a predicate function on elements into a predicate-step usable in selectors.
Turns a predicate function on elements into a predicate-step usable in selectors.
(prepend & values)
Prepends the values to the content of the selected element.
Prepends the values to the content of the selected element.
(re-pred re)
Turns a regex into a predicate-step on text nodes usable in selectors.
Turns a regex into a predicate-step on text nodes usable in selectors.
(remove-attr & attr-names)
Dissocs attributes on the selected element.
Dissocs attributes on the selected element.
(remove-class & classes)
Removes the specified classes from the selected element.
Removes the specified classes from the selected element.
(replace-vars m)
(replace-vars re m)
(replace-vars re m f)
By default, takes a map (or function) of keywords to strings and replaces all occurences of ${foo} by (m :foo) in text nodes and attributes. Does not recurse, you have to pair it with an appropriate selector. re is a regex whose first group will be passed to (comp m f) and f by default is #'keyword.
By default, takes a map (or function) of keywords to strings and replaces all occurences of ${foo} by (m :foo) in text nodes and attributes. Does not recurse, you have to pair it with an appropriate selector. re is a regex whose first group will be passed to (comp m f) and f by default is #'keyword.
(replace-words words-to-replacements)
Takes a map of words to replacement strings and replaces all occurences. Does not recurse, you have to pair it with an appropriate selector.
Takes a map of words to replacement strings and replaces all occurences. Does not recurse, you have to pair it with an appropriate selector.
(right selector-step)
Selector predicate, matches nodes whose immediate right sibling element is matched by the specified selector-step.
Selector predicate, matches nodes whose immediate right sibling element is matched by the specified selector-step.
(rights selector-step)
Selector predicate, matches nodes whose one left sibling element is matched by the specified selector-step.
Selector predicate, matches nodes whose one left sibling element is matched by the specified selector-step.
(select node-or-nodes selector)
Returns the seq of nodes or fragments matched by the specified selector.
Returns the seq of nodes or fragments matched by the specified selector.
(set-attr & kvs)
Assocs attributes on the selected element.
Assocs attributes on the selected element.
(set-ns-options! options)
Sets the default options to use by all templates and snippets in the declaring ns.
Sets the default options to use by all templates and snippets in the declaring ns.
(set-ns-parser! parser)
Sets the default parser to use by all templates and snippets in the declaring ns.
Sets the default parser to use by all templates and snippets in the declaring ns.
(snippet source selector args & forms)
A snippet is a function that returns a seq of nodes.
A snippet is a function that returns a seq of nodes.
(sniptest source-string & forms)
A handy macro for experimenting at the repl
A handy macro for experimenting at the repl
(strict-mode & forms)
Adds xhtml-transitional DTD to switch browser in 'strict' mode.
Adds xhtml-transitional DTD to switch browser in 'strict' mode.
(substitute & values)
Replaces the current selection (node or fragment).
Replaces the current selection (node or fragment).
(tag= tag-name)
Selector predicate, :foo is as short-hand for (tag= :foo).
Selector predicate, :foo is as short-hand for (tag= :foo).
(template source args & forms)
A template returns a seq of string.
A template returns a seq of string.
(text node)
Returns the text value of a node.
Returns the text value of a node.
(text-pred f)
Turns a predicate function on strings (text nodes) into a predicate-step usable in selectors.
Turns a predicate function on strings (text nodes) into a predicate-step usable in selectors.
(texts nodes)
Returns the text value of a nodes collection.
Returns the text value of a nodes collection.
(xml-parser stream)
Loads and parse a XML resource and closes the stream.
Loads and parse a XML resource and closes the stream.
(xml-resource resource)
Loads an XML resource, returns a seq of nodes.
Loads an XML resource, returns a seq of nodes.
(zip-pred f)
Turns a predicate function on elements locs into a predicate-step usable in selectors.
Turns a predicate function on elements locs into a predicate-step usable in selectors.
(zip-select locs selector)
Returns the seq of locs matched by the specified selector.
Returns the seq of locs matched by the specified selector.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close