Copyright © 2016-2020 Marc Worrell
Behaviours: template_compiler_runtime.
Authors: Marc Worrell (marc@worrell.nl).
builtin_tag/5 | Render image/image_url/media/url/lib tag. |
cache_tag/6 | Render a block, cache the result for some time. |
compile_map_nested_value/3 | Compile time mapping of nested value lookup. |
custom_tag/4 | Render a custom tag (Zotonic scomp). |
escape/2 | HTML escape a value. |
find_nested_value/3 | Find a list of values at once, easier and more efficient than a nested find_value/4 Add pattern matching here for nested lookups. |
find_nested_value/4 | Find a list of values at once, easier and more efficient than a nested find_value/4 Add pattern matching here for nested lookups. |
find_value/4 | Find the value of key in some structure. |
get_context_name/1 | |
get_translations/2 | Fetch the translations for the given text. |
is_modified/3 | Check if a file has been modified. |
javascript_tag/3 | Render a script block, for Zotonic this is added to the scripts in the Context. |
lookup_translation/3 | Find the best fitting translation. |
map_template/3 | Dynamic mapping of a template to a template name, context sensitive on the template vars. |
map_template_all/3 | Dynamically find all templates matching the template. |
set_context_vars/2 | |
spaceless_tag/3 | Remove spaces between HTML tags. |
to_bool/2 | Convert a value to a boolean. |
to_list/2 | Convert a value to a list. |
to_render_result/3 | Convert a value to an iolist, used for converting values in {{ ... |
to_simple_value/2 | Convert a value to something that can be handled as an argument to scomps. |
to_simple_values/2 | Convert an argument list's values to something that can be handled as an argument to scomps. |
trace_block/4 | Called when a block function is called. |
trace_compile/4 | Called when compiling a module. |
trace_render/3 | Called when a template is rendered (could be from an include). |
builtin_tag(Tag::template_compiler:builtin_tag(), Expr::term(), Args::list(), Vars::map(), Context::term()) -> template_compiler:render_result()
Render image/image_url/media/url/lib tag. The Expr is the media item or dispatch rule.
cache_tag(MaxAge::integer(), Name::binary(), Args::list(), Fun::function(), TplVars::map(), Context::term()) -> template_compiler:render_result()
Render a block, cache the result for some time. Caching should be implemented by the runtime.
compile_map_nested_value(Tokens::list(), ContextVar::string(), Context::term()) -> NewTokens::list()
Compile time mapping of nested value lookup
custom_tag(Tag::atom(), Args::list(), Vars::map(), Context::term()) -> template_compiler:render_result()
Render a custom tag (Zotonic scomp)
escape(Value::iodata() | undefined, Context::z:context()) -> iodata()
HTML escape a value
find_nested_value(Ks, TplVars, Context) -> any()
Find a list of values at once, easier and more efficient than a nested find_value/4 Add pattern matching here for nested lookups.
find_nested_value(V, Ks, TplVars, Context) -> any()
Find a list of values at once, easier and more efficient than a nested find_value/4 Add pattern matching here for nested lookups.
find_value(Key::term(), Vars::term(), TplVars::map(), Context::term()) -> term()
Find the value of key in some structure.
get_context_name(Context::term()) -> atom()
get_translations(Text::binary(), Context::term()) -> binary() | z:trans()
Fetch the translations for the given text.
is_modified(Filename::file:filename_all(), Mtime::calendar:datetime(), Context::term()) -> boolean()
Check if a file has been modified
javascript_tag(Block::template_compiler:render_result(), TplVars::map(), Context::term()) -> template_compiler:render_result()
Render a script block, for Zotonic this is added to the scripts in the Context
lookup_translation(Trans::z:trans(), TplVars::map(), Context::term()) -> binary()
Find the best fitting translation.
map_template(Template_file::template_compiler:template(), Vars::map(), Context::term()) -> {ok, template_compiler:template_file()} | {error, enoent | term()}
Dynamic mapping of a template to a template name, context sensitive on the template vars.
map_template_all(Template::template_compiler:template(), Vars::map(), Context::term()) -> [template_compiler:template_file()]
Dynamically find all templates matching the template
set_context_vars(Args::map() | list(), Context::term()) -> term()
spaceless_tag(Value::template_compiler:render_result(), TplVars::map(), Context::term()) -> template_compiler:render_result()
Remove spaces between HTML tags
to_bool(Value::term(), Context::term()) -> boolean()
Convert a value to a boolean.
to_list(Value::term(), Context::term()) -> list()
Convert a value to a list.
to_render_result(Value::term(), TplVars::map(), Context::term()) -> template_compiler:render_result()
Convert a value to an iolist, used for converting values in {{ ... }} expressions.
to_simple_value(Value::term(), Context::term()) -> term()
Convert a value to something that can be handled as an argument to scomps.
to_simple_values(Args::list(), Context::term()) -> list()
Convert an argument list's values to something that can be handled as an argument to scomps.
trace_block(X1::{binary(), integer(), integer()}, Name::atom(), Module::atom(), Context::term()) -> ok | {ok, iodata(), iodata()}
Called when a block function is called
trace_compile(Module::atom(), Filename::binary(), Options::template_compiler:options(), Context::z:context()) -> ok
Called when compiling a module
trace_render(Filename::binary(), Options::template_compiler:options(), Context::z:context()) -> ok | {ok, iodata(), iodata()}
Called when a template is rendered (could be from an include)
Generated by EDoc