diff --git a/spork/temple.janet b/spork/temple.janet index 3bfd773..f3c2e40 100644 --- a/spork/temple.janet +++ b/spork/temple.janet @@ -127,21 +127,25 @@ [path &] (with-dyns [:current-file path] (let [tmpl (create (slurp path) path)] - @{'render @{:doc "Main template function." - :value (fn render [&keys args] (tmpl args))} - 'render-dict @{:doc "Template function, but pass arguments as a dictionary." - :value tmpl} - 'capture @{:doc "Template function that returns buffer of rendered template." - :value (fn render [&keys args] - (def b @"") - (with-dyns [:out b] (tmpl args) - b))} - 'capture-dict @{:doc "Template function that returns buffer of rendered template, + @{'render + @{:doc "Main template function." + :value (fn render [&keys args] (tmpl args))} + 'render-dict + @{:doc "Template function, but pass arguments as a dictionary." + :value tmpl} + 'capture + @{:doc "Template function that returns buffer of rendered template." + :value (fn capture [&keys args] + (def b @"") + (with-dyns [:out b] (tmpl args)) + b)} + 'capture-dict + @{:doc "Template function that returns buffer of rendered template, but pass arguments as a dictionary." - :value (fn render [args] - (def b @"") - (with-dyns [:out b] (tmpl args) - b))}}))) + :value (fn capture-dict [args] + (def b @"") + (with-dyns [:out b] (tmpl args)) + b)}}))) (defn add-loader "Adds the custom template loader to Janet's module/loaders and