View Source erlte_renderer (erlte v0.1.0)
Link to this section Summary
Functions
Render the compiled template replacing the specified variables There is no error return case now but some maybe added in the future so for compatibility reasons you should handle a generic error case too.
Render the compiled template replacing the specified variables and return a new compiled template There is no error return case now but some maybe added in the future so for compatibility reasons you should handle a generic error case too.
Render compiled template to the specified file
Render compiled template replacing the specified variables and save the result into the specified file
Link to this section Functions
-spec render(Compiled, Variables) -> {ok, Result} | {error, Error} when Compiled :: erlte:compiled(), Variables :: list(), Result :: binary(), Error :: term().
-spec render_to_compiled(Compiled, Variables) -> {ok, NewCompiled} | {error, Error} when Compiled :: erlte:compiled(), Variables :: list(), NewCompiled :: erlte:compiled(), Error :: term().
-spec render_to_file(Filename, Compiled) -> {ok, Result} | {error, Reason} when Filename :: file:name_all(), Compiled :: erlte:compiled(), Result :: binary(), Reason :: file:posix() | badarg | terminated | system_limit.
-spec render_to_file(Filename, Compiled, Variables) -> {ok, Result} | {error, Reason} when Filename :: file:name_all(), Compiled :: erlte:compiled(), Variables :: undefined | list(), Result :: binary(), Reason :: file:posix() | badarg | terminated | system_limit.