Sablon.Content.WordML (sablon v0.4.3)

Copy Markdown View Source

Direct insertion of WordProcessingML into the template.

When every node being inserted is a valid child of w:p the markup is added inline and only the merge field's run is replaced; otherwise the whole paragraph containing the field is replaced. Run properties of the field are merged into the inserted runs, but only where the inserted markup does not define them itself.

Summary

Functions

Returns true when all top level nodes may live inside a w:p element.

Compares two WordML values by the markup they insert.

Parses a WordML string into content. A parsed fragment is used as-is.

The top level nodes of the fragment.

The markup this content will insert.

Types

t()

@type t() :: %Sablon.Content.WordML{xml: Sablon.XML.Document.t()}

Functions

all_inline?(content)

@spec all_inline?(t()) :: boolean()

Returns true when all top level nodes may live inside a w:p element.

equal?(left, right)

@spec equal?(t(), t()) :: boolean()

Compares two WordML values by the markup they insert.

new(fragment)

@spec new(binary() | Sablon.XML.Document.t()) :: t()

Parses a WordML string into content. A parsed fragment is used as-is.

nodes(word_ml)

@spec nodes(t()) :: [Sablon.XML.Node.t()]

The top level nodes of the fragment.

to_xml(word_ml)

@spec to_xml(t()) :: binary()

The markup this content will insert.