(render! ngn file-in params)
(render! ngn file-in params output)
Renders the template found at <file-in> (slotting in named <params>) to <output>,
which should be an instance of String/Path/File/Writer (defaults to *out*
).
For String outputs in particular, you probably want render-to-string
instead.
For anything other than Strings, what this function returns (i.e. TemplateOutput
)
can be ignored. The values in the <params> map are checked for type-validity prior
to calling TemplateEngine::render
. The keys are converted to String
(via clojure.core/name
), so the template file (.jte) should declare them as such.
Renders the template found at <file-in> (slotting in named <params>) to <output>, which should be an instance of String/Path/File/Writer (defaults to `*out*`). For String outputs in particular, you probably want `render-to-string` instead. For anything other than Strings, what this function returns (i.e. `TemplateOutput`) can be ignored. The values in the <params> map are checked for type-validity prior to calling `TemplateEngine::render`. The keys are converted to String (via `clojure.core/name`), so the template file (.jte) should declare them as such.
(render-to-string ngn file-in params)
(render-to-string ngn file-in params s)
Like render!
but returns a String - not a TemplateOutput
.
Like `render!` but returns a String - not a `TemplateOutput`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close