Liking cljdoc? Tell your friends :D

selmer.parser

Parsing and handling of compile-time vs. run-time. Avoiding unnecessary work by pre-processing the template structure and content and reacting to the runtime context map with a prepared data structure instead of a raw template. Anything other than a raw tag value injection is a runtime dispatch fn. Compile-time here means the first time we see a template at runtime, not the implementation's compile-time.

 Parsing and handling of compile-time vs.
run-time. Avoiding unnecessary work by pre-processing
the template structure and content and reacting to
the runtime context map with a prepared data structure
instead of a raw template. Anything other than a raw tag
value injection is a runtime dispatch fn. Compile-time here
means the first time we see a template *at runtime*, not the
implementation's compile-time. 
raw docstring

<<cljmacro

(<< s)

Resolves the variables from your template string from the local-env, or the namespace and puts them into your template for you.

e.g. (let [a 1] (<< "{{a}} + {{a}} = 2")) ;;=> "1 + 1 = 2"

Resolves the variables from your template string from the local-env, or the
namespace and puts them into your template for you.

e.g. (let [a 1] (<< "{{a}} + {{a}} = 2")) ;;=> "1 + 1 = 2" 
sourceraw docstring

add-filter!clj

source

add-nodeclj

(add-node template buf rdr)
source

add-tag!cljmacro

(add-tag! k handler & tags)

tag name, fn handler, and maybe tags

 tag name, fn handler, and maybe tags 
sourceraw docstring

append-nodeclj

(append-node content tag buf rdr)
source

cache-off!clj

(cache-off!)
source

cache-on!clj

(cache-on!)
source

cache?clj

source

ensure-listclj

(ensure-list list-maybe)

Turns the argument into a list if it isn't a list already.

Turns the argument into a list if it isn't a list already.
sourceraw docstring

expr-tagclj

(expr-tag {:keys [tag-name args]} rdr)
source

filter-tagclj

(filter-tag {:keys [tag-value]})

Compile-time parser of var tag filters.

 Compile-time parser of var tag filters. 
sourceraw docstring

known-variable-pathsclj

(known-variable-paths input & [opts])
source

known-variablesclj

(known-variables input & [opts])
source

parseclj

(parse parse-fn
       input
       &
       [{:keys [tag-open tag-close filter-open filter-close tag-second
                short-comment-second]
         :or {tag-open *tag-open*
              tag-close *tag-close*
              filter-open *filter-open*
              filter-close *filter-close*
              tag-second *tag-second*
              short-comment-second *short-comment-second*}
         :as params}])
source

parse*clj

(parse* input)
source

parse-fileclj

(parse-file file params)
source

parse-inputclj

(parse-input input & [{:keys [custom-tags custom-filters]}])
source

parse-tagclj

(parse-tag {:keys [tag-type] :as tag} rdr)
source

remove-tag!clj

(remove-tag! k)
source

renderclj

(render s context-map & [opts])

render takes the string, the context-map and possibly also opts.

 render takes the string, the context-map and possibly also opts. 
sourceraw docstring

render-fileclj

(render-file filename-or-url
             context-map
             &
             [{:keys [cache custom-resource-path url-stream-handler]
               :or {cache (clojure.core/deref cache?)
                    custom-resource-path *custom-resource-path*
                    url-stream-handler *url-stream-handler*}
               :as opts}])

Parses files if there isn't a memoized post-parse vector ready to go, renders post-parse vector with passed context-map regardless. Double-checks last-modified on files. Uses classpath for filename-or-url path

 Parses files if there isn't a memoized post-parse vector ready to go,
renders post-parse vector with passed context-map regardless. Double-checks
last-modified on files. Uses classpath for filename-or-url path 
sourceraw docstring

render-templateclj

(render-template template context-map)

vector of ^selmer.node.INodes and a context map.

 vector of ^selmer.node.INodes and a context map.
sourceraw docstring

resolve-argclj

(resolve-arg arg context-map)

Resolves an arg as passed to an add-tag! handler using the provided context-map.

A custom tag handler will receive a seq of args as its first argument. With this function, you can selectively resolve one or more of those args so that if they contain literals, the literal value is returned, and if they contain templates of any sort, which can itself have variables, filters or tags in it, they will be returned resolved, applied and rendered.

Example: (resolve-arg {{header-name|upper}} {:header-name "My Page"}) => "MY PAGE"

Resolves an arg as passed to an add-tag! handler using the provided
context-map.

A custom tag handler will receive a seq of args as its first argument.
With this function, you can selectively resolve one or more of those args
so that if they contain literals, the literal value is returned, and if they
contain templates of any sort, which can itself have variables, filters or
tags in it, they will be returned resolved, applied and rendered.

Example:
  (resolve-arg {{header-name|upper}} {:header-name "My Page"})
  => "MY PAGE"
sourceraw docstring

set-closing-tags!clj

(set-closing-tags! & tags)
source

set-resource-path!clj

(set-resource-path! path)

set custom location, where templates are being searched for. path may be a java.net.URL instance or a string. If it's a string, we first try to convert it to a java.net.URL instance and if it doesn't work it's interpreted as a path in the local filesystem.

set custom location, where templates are being searched for. path
may be a java.net.URL instance or a string. If it's a string, we
first try to convert it to a java.net.URL instance and if it doesn't
work it's interpreted as a path in the local filesystem.
sourceraw docstring

skip-short-comment-tagclj

(skip-short-comment-tag rdr)
source

tag-contentclj

(tag-content rdr start-tag & end-tags)

Parses the content of a tag. Returns a map of tag-name -> args & content, which can then be interpreted by the calling function.

Parses the content of a tag.
Returns a map of tag-name -> args & content, which can then be interpreted by the calling function.
sourceraw docstring

templatesclj

source

update-tagclj

(update-tag tag-map tag tags)
source

update-tagsclj

(update-tags tag tags content args buf)

Assocs in the passed tag to the tags map.

Assocs in the passed tag to the tags map.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close