A Word document used as a template.
Rendering reads the whole package into a Sablon.DOM.Model, runs every
registered processor over the parts it applies to, and writes the result back
out as a new .docx. The template itself is never modified.
Summary
Functions
Points at a template on disk.
The processors registered for a part.
Registers a processor for the parts whose name matches pattern.
Renders the template, returning both the .docx binary and the document
model it was produced from. The model is useful for inspecting what a render
did without unzipping the result again.
Renders the template and writes the result to output_path.
Renders the template and returns the resulting .docx as a binary.
Types
@type t() :: %Sablon.Template{path: Path.t()}
Functions
Points at a template on disk.
The processors registered for a part.
Registers a processor for the parts whose name matches pattern.
Renders the template, returning both the .docx binary and the document
model it was produced from. The model is useful for inspecting what a render
did without unzipping the result again.
The model holds the parsed document in the calling process; call
Sablon.DOM.Model.drop/1 when done with it, or use render_to_string/3,
which cleans up on its own.
Renders the template and writes the result to output_path.
Renders the template and returns the resulting .docx as a binary.