glimpse.impl.default.bindings

Functions that provide data binding support to Enlive templates.

bind-prop

(bind-prop node data)
Binds the provided data to the node.

If data is not a map, it is converted to a string and used to replace the
existing node content.

If data is a map, all keys except :content are treated as attributes to be
appended to node. The :content value, if provided, will replace any existing
content in the node. A nil value will remove the corresponding attribute or
content from the node.

bind-prop-map

(bind-prop-map node m)
Binds the map to the node. All keys except :content are treated as attributes
to be appended to node. The :content value, if provided, will replace any existing
content in the node.

A nil value will remove the corresponding attribute or content from the node.

bind-scope

(bind-scope nodes scope data)(bind-scope node data)
Binds the provided data to a scope.

If a scope value is provided, the scope is looked up in the collection of
nodes provided.  Otherwise, it is assumed that a single node (the scope node)
is provided and the supplied data will be bound to it.

Data may be either sequential or a map.  If the data is sequential, the scope
node is duplicated for and bound to each element in the sequence.  If a map
is provided, the keys are looked up in the children elements as property or
scope nodes.  If a property node is found corresponding to the key, its value
is bound to the node.  If a scope node is found instead, the new scope node
is bound to the value.

prop-node?

(prop-node? node)
Gets a value indicating whether the node provided is a property node.

prototype-node?

(prototype-node? node)
Gets a value indicating whether the node provided is a prototype node.

remove-prototype-nodes

(remove-prototype-nodes nodes)
Removes all scope nodes that are marked with data-prototype.

scope-node?

(scope-node? node)
Gets a value indicating whether the node provided is a scope node.

scope-selector

(scope-selector scope)
Selector predicate, matches a top-level or nested scope element.