tokumei v0.6.4 Tokumei.Templates

Generate render functions for a directory of templates.

defmodule TemplatesExample do
  use Tokumei.Templates, "./templates"
end

Rendering a template will return a partial response with mime type set. This can be passed directly to response functions

  Raxx.Response.ok("example.html", content: "Hi!")

Templates have:

  • A name: filename without eex extension
  • A mime type: derived from the file extension

TODO a nice error message when a function is called and no files exits. include path where file was looked for and use word diff to come up with a did you mean.