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

Link to this function

render(Compiled, Variables)

View Source
-spec render(Compiled, Variables) -> {ok, Result} | {error, Error}
          when
              Compiled :: erlte:compiled(),
              Variables :: list(),
              Result :: binary(),
              Error :: term().
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.
Link to this function

render_to_compiled(Compiled, Variables)

View Source
-spec render_to_compiled(Compiled, Variables) -> {ok, NewCompiled} | {error, Error}
                      when
                          Compiled :: erlte:compiled(),
                          Variables :: list(),
                          NewCompiled :: erlte:compiled(),
                          Error :: term().
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.
Link to this function

render_to_file(Filename, Compiled)

View Source
-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.
Render compiled template to the specified file
Link to this function

render_to_file(Filename, Compiled, Variables)

View Source
-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.
Render compiled template replacing the specified variables and save the result into the specified file