Copyright © 2016 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
builtin_tag() = image | image_url | image_data_url | media | url | lib
option() = {runtime, atom()} | {context_name, term()} | {trace_position, {Filename::binary(), Line::integer(), Col::integer()}} | {context_vars, [binary()]}
options() = [option()]
render_result() = binary() | string() | term() | [render_result()]
template() = binary() | string() | {cat, binary() | string()} | {cat, binary() | string(), term()} | {overrules, binary() | string(), file:filename_all()} | template_file()
template_file() = #template_file{}
template_key() = {ContextName::term(), Runtime::atom(), template()}
translation_message() = {Text::binary(), Args::proplists:proplist(), {Filename::file:filename(), Line::pos_integer(), Column::pos_integer()}}
compile_binary/4 | Compile a in-memory template to a module. |
compile_file/3 | Compile a template to a module. |
flush/0 | Remove all template lookups, forces recheck. |
flush_context_name/1 | Ping that a template has been changed. |
flush_file/1 | Ping that a template has been changed. |
get_option/2 | Extract compiler options and handle possible defauts. |
is_template_module/1 | Check if the modulename looks like a module generated by the template compiler. |
lookup/3 | Find the module of a compiled template, if not yet compiled then compile the template. |
render/4 | Render a template. |
render_block/5 | Render a named block, defined in a template. |
translations/1 | Fetch all translatable strings from a template. |
compile_binary(Tpl::binary(), Filename::file:filename_all(), Options::options(), Context::term()) -> {ok, atom()} | {error, term()}
Compile a in-memory template to a module.
compile_file(Filename::file:filename_all(), Options::options(), Context::term()) -> {ok, atom()} | {error, term()}
Compile a template to a module. The template is the path of the template to be compiled.
flush() -> ok
Remove all template lookups, forces recheck.
flush_context_name(ContextName::term()) -> ok
Ping that a template has been changed
flush_file(Filename::file:filename_all()) -> ok
Ping that a template has been changed
get_option(Option::atom(), Options::options()) -> term()
Extract compiler options and handle possible defauts.
is_template_module(X::binary() | string() | atom()) -> boolean()
Check if the modulename looks like a module generated by the template compiler.
lookup(Filename::binary(), Options::options(), Context::term()) -> {ok, atom()} | {error, term()}
Find the module of a compiled template, if not yet compiled then compile the template.
render(Template::template(), Vars::map() | list(), Options::options(), Context::term()) -> {ok, render_result()} | {error, term()}
Render a template. This looks up the templates needed, ensures compilation and returns the rendering result.
render_block(Block::atom(), Template::template(), Vars::map() | list(), Options::options(), Context::term()) -> {ok, render_result()} | {error, term()}
Render a named block, defined in a template
translations(Filename::file:filename_all()) -> {ok, [translation_message()]} | {error, term()}
Fetch all translatable strings from a template.
Generated by EDoc