glimpse.impl.default.layout

Functions for manipulating Enlive templates using layout directives.

construct-view

(construct-view uri loader)
Constructs a complete view given a request uri and loader.

container-element-node

(container-element-node)(container-element-node container-name)
Selector predicate, matches container elements.

container-name

(container-name s)
Finds the container name from the string.

Returns :default if the string is a container directive with no name.  Returns
nil if not found.

container-node

Selector predicate, matches valid @container directives.

create-container-elements

(create-container-elements nodes)
Transforms container directives into element nodes.

find-template-name

(find-template-name nodes)
Finds the template name in the collection of nodes.

Returns a default value if no template name is found.  Throws an exception if
more than one template name is found.

ILoader

protocol

Represents an entity that can load Enlive nodes given a request uri and a
name.

members

load-page

(load-page this uri)
Loads a page fragment based on the request uri and an optional name.

load-partial

(load-partial this uri name)
Loads a partial fragment based on the request uri and name.

load-template

(load-template this uri name)
Loads an entire document based on the request uri and provided name.

include-all

(include-all nodes loader uri)(include-all nodes loader uri max-depth)
Replaces @include directives with appropriate content fetched via the
specified loader.  Subject to a max-depth, which defaults to 10.

include-name

(include-name s)
Finds the include name in the string.

Returns nil if not found.

include-node

Selector predicate, matches nodes that contain an include directive.

mark-scopes-as-unbound

(mark-scopes-as-unbound nodes)
Adds a data-glimpse-unbound attribute to all scope nodes.

move-within-containers

(move-within-containers nodes)
Finds within fragments within nodes, removes them, and places their content
within the specified containers.

template-name

(template-name s)
Finds the template name from the string. Returns nil if not found.

template-node

Selector predicate, matches valid template directives.

within-ending-node

Selector predicate, matches nodes that end a within directive fragment.

within-fragment-selector

Fragment selector for within directives.

within-name

(within-name s)
Finds the container name from the string.

Returns nil if not found.

within-starting-node

Selector predicate, matches nodes that start a within directive fragment.