Liking cljdoc? Tell your friends :D

stencil.utils


call-lambdaclj

(call-lambda lambda-fn context render)
(call-lambda lambda-fn context render content)

Calls a lambda function, respecting the options given in its metadata, if any. The content arg is the content of the tag being processed as a lambda in the template, and the context arg is the current context at this point in the processing. The latter will be ignored unless metadata directs otherwise.

Respected metadata:

  • :stencil/pass-context: passes the current context to the lambda as the second arg.

  • :stencil/pass-render: the lambda will receive the context and the render function to be used in this context, respecting custom section delimiters

Calls a lambda function, respecting the options given in its metadata, if
any. The content arg is the content of the tag being processed as a lambda in
the template, and the context arg is the current context at this point in the
processing. The latter will be ignored unless metadata directs otherwise.

Respected metadata:
  - :stencil/pass-context: passes the current context to the lambda as the
    second arg.

  - :stencil/pass-render: the lambda will receive the context
    and the render function to be used in this context, respecting
    custom section delimiters
sourceraw docstring

context-getclj

(context-get context-stack key)
(context-get context-stack key not-found)

Given a context stack and key, implements the rules for getting the key out of the context stack (see interpolation.yml in the spec). The key is assumed to be either the special keyword :implicit-top, or a list of strings or keywords.

Given a context stack and key, implements the rules for getting the
key out of the context stack (see interpolation.yml in the spec). The
key is assumed to be either the special keyword :implicit-top, or a list of
strings or keywords.
sourceraw docstring

core-cache-present?clj

(core-cache-present?)

Returns true if the core.cache library is available, and false otherwise.

Returns true if the core.cache library is available, and false otherwise.
sourceraw docstring

find-containing-contextclj

(find-containing-context context-stack key)

Given a context stack and a key, walks down the context stack until it finds a context that contains the key. The key logic is fuzzy as in get-named/contains-named? in quoin. Returns the context, not the key's value, so nil when no context is found that contains the key.

Given a context stack and a key, walks down the context stack until
it finds a context that contains the key. The key logic is fuzzy as
in get-named/contains-named? in quoin. Returns the context, not the
key's value, so nil when no context is found that contains the
key.
sourceraw docstring

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

× close