Module template_compiler_runtime_internal

Callback routines for compiled templates.

Copyright © 2016-2021 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Callback routines for compiled templates.

Function Index

block_call/6Call the block function, lookup the function in the BlockMap to find the correct module.
block_inherit/7Call the block function of the template the current module extends.
call/4Call a module's render function.
forloop/9Runtime implementation of a forloop.
include/9Include a template.
print/1Echo the HTML escape value within <pre> tags.
unique/0Make an unique string (about 11 characters).
with_vars/3Assign variables from a with statement.

Function Details

block_call/6

block_call(SrcPos::{binary(), integer(), integer()}, Block::atom(), Vars::map(), BlockMap::map(), Runtime::atom(), Context::term()) -> term()

Call the block function, lookup the function in the BlockMap to find the correct module.

block_inherit/7

block_inherit(SrcPos::{binary(), integer(), integer()}, Module::atom(), Block::atom(), Vars::map(), BlockMap::map(), Runtime::atom(), Context::term()) -> term()

Call the block function of the template the current module extends.

call/4

call(Module::atom(), Args::map(), Vars::map(), Context::term()) -> template_compiler:render_result()

Call a module's render function.

forloop/9

forloop(IsForloopVar::boolean(), ListExpr::term(), LoopVars::[atom()], LoopBody::function(), EmptyPart::function(), Runtime::atom(), IsContextVars::boolean(), Vars::map(), Context::term()) -> term()

Runtime implementation of a forloop. Two variations: one with

include/9

include(SrcPos::{File::binary(), Line::integer(), Col::integer()}, Method::normal | optional | all, Template::template_compiler:template(), Args::[{atom(), term()}], Runtime::atom(), ContextVars::[binary()], IsContextVars::boolean(), Vars::map(), Context::term()) -> template_compiler:render_result()

Include a template.

print/1

print(Expr::term()) -> iolist()

Echo the HTML escape value within <pre> tags.

unique/0

unique() -> binary()

Make an unique string (about 11 characters). Used for expanding unique args in templates. The string only consists of the characters A-Z and 0-9 and is safe to use as HTML element id.

with_vars/3

with_vars(Vs::[atom()], Es::[term()], Vars::map()) -> map()

Assign variables from a with statement. Care has to be taken for unpacking tuples and lists.


Generated by EDoc