(create-tag-func tag-info)(ns-binding & requires-and-body)Temporarily loads one or more external namespaces into juce.core and evaluates the given body in that context.
Usage: (ns-binding '[my.tags :as t] (render "(div (t/button "Click"))"))
Parameters:
requires-and-body - A sequence where all but the last element are require forms (vectors),
and the last element is the body expression to evaluate.
Behavior:
*ns* bound to juce.core.render.Returns: The result of evaluating the body expression.
Temporarily loads one or more external namespaces into `juce.core` and evaluates the given body in that context.
Usage:
(ns-binding '[my.tags :as t]
(render "(div (t/button \"Click\"))"))
Parameters:
requires-and-body - A sequence where all but the last element are `require` forms (vectors),
and the last element is the body expression to evaluate.
Behavior:
- Each require form is evaluated with `*ns*` bound to `juce.core`.
- The body is then evaluated in the same namespace.
- Useful for making custom tag functions available inside `render`.
Returns:
The result of evaluating the body expression.(parse-args args)(render s)(render s env)Evaluates a juce template string and returns the rendered HTML.
Usage: (render "(div :class "x" "Hello")") (render "(p (:name user))" {:user {:name "Alice"}})
Parameters: s - String containing a juce DSL expression. env - Optional map. Keys become local symbols inside the template.
Behavior:
env bindings are injected as locals.juce.core namespace.render-node.Returns: HTML string.
Evaluates a juce template string and returns the rendered HTML.
Usage:
(render "(div :class \"x\" \"Hello\")")
(render "(p (:name user))" {:user {:name "Alice"}})
Parameters:
s - String containing a juce DSL expression.
env - Optional map. Keys become local symbols inside the template.
Behavior:
- The template string is read as a Clojure form.
- `env` bindings are injected as locals.
- The form is evaluated in the `juce.core` namespace.
- The result is converted to HTML via `render-node`.
Returns:
HTML string.(render-attrs attrs predicate-attrs)(render-file path)(render-file path env)Reads a juce template file and returns the rendered HTML.
Usage: (render-file "template.juce") (render-file "template.juce" {:name "Alice"})
Parameters: path - Path to a file containing a juce DSL expression. env - Optional map of local bindings.
Returns: HTML string.
Reads a juce template file and returns the rendered HTML.
Usage:
(render-file "template.juce")
(render-file "template.juce" {:name "Alice"})
Parameters:
path - Path to a file containing a juce DSL expression.
env - Optional map of local bindings.
Returns:
HTML string.(render-node node)(slurp-file path)Internal. Reads a file from disk and returns its contents as a string.
Internal. Reads a file from disk and returns its contents as a string.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |