glimpse.impl.enlive-helpers

Functions to manipulate Enlive templates, especially for comment nodes.

comment-matches

(comment-matches re)
Selector predicate, tests if the node is a comment and whose data matches re.

comment-pred

(comment-pred f)
Turns a predicate on strings into a predicate-step that selects comment nodes
that satisfy the predicate.

comment=

(comment= s)
Selector predicate, tests if the node is a comment and whose data is equal to s.

IEnliveView

protocol

A protocol for converting views into Enlive-compatible representations.

members

->enlive

(->enlive this)
Converts the view into Enlive nodes.

node-content

(node-content node)
Gets the content of a node if found.  Otherwise, returns an empty vector.

parse-document

(parse-document html-str)
Transforms an HTML string into Enlive nodes for an entire document.

parse-fragment

(parse-fragment html-str)
Transforms an HTML string into an Enlive fragment.

remove-nodes

(remove-nodes nodes selector)
Removes from nodes those which match the selector.

replace-with-children

(replace-with-children nodes selector)
Removes selected nodes and replaces them with their respective children.