No matching definitions.

tourist/template

src/tourist/template.tur

render templates for routes (requires tur-template dep).

Since: v0.1.0

defn

render-template

(render-template [path : cstr env : int] :)

render a template file against an Env.

pathpath to the template file, e.g. "views/greet.html.tur"
envEnv handle from env-new or make-env

:cstr -- rendered output, owned by the caller ("" on failure)

(render-template "views/index.html.tur" e)  ; => "<p>Hello, alice!</p>"

Since: v0.1.0 (always heap-allocated since tourist-on-stdlib-httpd H5)

defn

render-html

(render-html [path : cstr env : int] :)

answer with a rendered template.

pathpath to the template file
envEnv handle

Response -- for the route to return

(get! "/" (fn [ctx] (render-html "views/index.html.tur" site-env)))

Since: tourist-on-stdlib-httpd H5

Internal definitions
__rt-empty-- internal: a heap-allocated "".
__rt-free-- internal: free a heap cstr.