Liking cljdoc? Tell your friends :D

stencil.loader


cacheclj

(cache template-name template-variant template-src)
(cache template-name template-variant template-src parsed-template)

Given a template name (string), variant key (string), template source (string), and optionally a parsed AST, and stores that entry in the template cache. Returns the parsed template.

Given a template name (string), variant key (string), template source
(string), and optionally a parsed AST, and stores that entry in the
template cache. Returns the parsed template.
sourceraw docstring

cache-getclj

(cache-get template-name)
(cache-get template-name template-variant)

Given a template name, attempts to fetch the template with that name from the template cache. If it is not in the cache, nil will be returned. Single argument version gets the default variant.

Given a template name, attempts to fetch the template with that
name from the template cache. If it is not in the cache, nil will
be returned. Single argument version gets the default variant.
sourceraw docstring

find-fileclj

(find-file template-name)

Given a name of a mustache template, attempts to find the corresponding file. Returns a URL if found, nil if not. First tries to find filename.mustache on the classpath. Failing that, looks for filename on the classpath. Note that you can use slashes as path separators to find a file in a subdirectory.

Given a name of a mustache template, attempts to find the corresponding
file. Returns a URL if found, nil if not. First tries to find
filename.mustache on the classpath. Failing that, looks for filename on the
classpath. Note that you can use slashes as path separators to find a file
in a subdirectory.
sourceraw docstring

invalidate-cacheclj

(invalidate-cache)

Clears all entries out of the cache.

Clears all entries out of the cache.
sourceraw docstring

invalidate-cache-entryclj

(invalidate-cache-entry template-name)

Given a template name, invalidates the cache entry for that name, if there is one.

Given a template name, invalidates the cache entry for that name, if there
is one.
sourceraw docstring

loadclj

(load template-name)
(load template-name template-variant variant-fn)

Attempts to load a mustache template by name. When given something like "myfile", it attempts to load the mustache template called myfile. First it will look in the dynamic template store, then look in the classpath for a file called myfile.mustache or just myfile.

With additional arguments template-variant and variant-fn, supports the load and caching of template variants. The template-variant arg is a variant key, while the variant-fn arg is a single argument function that will be called with the template source as argument before it is cached or returned.

Attempts to load a mustache template by name. When given something like
"myfile", it attempts to load the mustache template called myfile. First it
will look in the dynamic template store, then look in the classpath for
a file called myfile.mustache or just myfile.

With additional arguments template-variant and variant-fn, supports the load
and caching of template variants. The template-variant arg is a variant key,
while the variant-fn arg is a single argument function that will be called
with the template source as argument before it is cached or returned.
sourceraw docstring

register-templateclj

(register-template template-name content-string)

Allows one to register a template in the dynamic template store. Give the template a name and provide its content as a string.

Allows one to register a template in the dynamic template store. Give the
template a name and provide its content as a string.
sourceraw docstring

set-cacheclj

(set-cache cache)

Takes a core.cache cache as the single argument and resets the cache to that cache. In particular, the cache will now follow the cache policy of the given cache. Also note that using this function has the effect of flushing the template cache.

Takes a core.cache cache as the single argument and resets the cache to that
cache. In particular, the cache will now follow the cache policy of the given
cache. Also note that using this function has the effect of flushing
the template cache.
sourceraw docstring

template-cache-entryclj

(template-cache-entry src)
(template-cache-entry src parsed)

Given template source and parsed ASTNodes, creates a cache entry. If only source is given, parse tree is calculated automatically.

Given template source and parsed ASTNodes, creates a cache entry.
If only source is given, parse tree is calculated automatically.
sourceraw docstring

unregister-all-templatesclj

(unregister-all-templates)

Clears the dynamic template store. Also necessarily clears the template cache.

Clears the dynamic template store. Also necessarily clears the template
cache.
sourceraw docstring

unregister-templateclj

(unregister-template template-name)

Removes the template with the given name from the dynamic template store.

Removes the template with the given name from the dynamic template store.
sourceraw docstring

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

× close