API Reference sablon v#0.4.4

Copy Markdown View Source

Modules

A document template processor for Word .docx files.

The sablon command line interface.

Global, mutable configuration for HTML conversion.

The conversion rules for a single HTML tag.

The values that can be inserted into a template.

HTML insertion.

Image insertion.

Plain text insertion.

Direct insertion of WordProcessingML into the template.

Turns the user supplied context into the shape the renderer expects.

Raised when the supplied context does not fit what the template expects.

Adds default content types to [Content_Types].xml.

Helpers shared by the handlers that manipulate individual package parts.

An in-memory model of the whole .docx package.

Creates list definitions in word/numbering.xml.

A freshly created list definition.

Adds relationships to a .rels part.

Bundles the template being rendered with the user supplied context.

The tiny expression language used inside merge fields.

A dotted lookup starting from a context key.

A direct lookup of a context key.

A lenient HTML fragment parser.

Converts HTML into WordProcessingML.

Dispatch helpers shared by every AST node.

Converts an HTML tree into the AST the WordML writer consumes.

A bare sequence of AST nodes, rendered by concatenation.

An a element, rendered as an external hyperlink.

An ol or ul element.

A paragraph that is part of a list.

A br element, rendered as a line break inside a run.

The WordML property tag of an AST node, e.g. w:pPr for a paragraph.

A w:p element - the top level content container of a Word document.

The top level container of a converted HTML fragment.

A w:r element, i.e. a run of text with a single set of formatting.

A w:tbl element.

Visitors applied to the AST before it is written out.

Drops the trailing line break of a paragraph.

Finds the MailMerge fields in a document part.

A merge field spread over several runs, delimited by w:fldChar markers.

The behaviour shared by simple and complex merge fields.

A merge field stored as a single w:fldSimple element.

Processes the parts of a Word document that can contain merge fields.

The region of a document enclosed by a pair of control merge fields.

Turns merge fields into statements.

Handles «comment» ... «endComment» blocks.

Handles «value:if», «value:elsIf», «value:else» and «value:endIf» blocks.

Handles «items:each(item)» ... «items:endEach» blocks.

Handles «@figure:start» ... «@figure:end» image placeholders.

Walks the merge fields of a document part and turns them into statements.

Applies document level section properties supplied at render time.

An insertion-ordered property list.

Global registries for the pluggable parts of sablon.

The operations a template can perform.

Drops a block from the rendered document.

Renders the first block whose condition holds, or the else block.

Renders an image into a placeholder picture.

Replaces a merge field with the value of an expression.

Repeats a block once per item of an enumerable.

A Word document used as a template.

Raised when a template is structurally invalid, e.g. a block without an end field.

Helpers for asserting on generated documents.

Convenience entry points for the mutable XML layer.

A mutable XML document.

A handle on a node inside a Sablon.XML.Document.

A small, non-validating XML parser.

Turns a Sablon.XML tree back into XML text.

The mutable cell behind a document tree.

A small XPath 1.0 subset, sufficient for every query sablon performs.

A minimal in-memory ZIP reader and writer.