API Reference
Jinja2Cpp.Jinja2Wrapper.Jinja2Environment — Type
Jinja2EnvironmentType describing the context and settings of the Jinja2Template.
For more information see the source.
Jinja2Cpp.Jinja2Wrapper.Jinja2Environment — Method
Jinja2Environment(tmpl_dir::String)Creates a new environment object used for more flexible template customization. The tmpl_dir parameter specifies the directory path relative to which templates will be searched (when using constructions such as {% include %}, {% import %} or {% extend %}).
Jinja2Cpp.Jinja2Wrapper.Jinja2Template — Type
Jinja2TemplateA type containing information about the Jinja2 template used.
Jinja2Cpp.Jinja2Wrapper.Jinja2Template — Method
Jinja2Template([tmpl_env::Jinja2Environment, ] source::String; name::String = "")Creates a template object using a source Jinja2 string. In addition, the environment context tmpl_env can be passed. The optional name is used for debugging errors.
Jinja2Cpp.Jinja2Wrapper.jinja2_render — Function
jinja2_render(template::Jinja2Template, [, values]) -> StringRenders the provided Jinja2 template, replacing the template's placeholders with the corresponding values from vals.
Example
julia> tmpl = Jinja2Template("<p>Hello, {{ name }}!</p>");
julia> result = jinja2_render(tmpl, Dict("name" => "Julia"))
"<p>Hello, Julia!</p>"You can find more examples in Manual section.
Jinja2Cpp.Jinja2Wrapper.Jinja2Error — Type
Jinja2Error <: ExceptionError thrown when Jinja2 syntax is invalid.
Fields
code::Int: Error code.message::String: Error message.