Name
cx:pebble — Expands Pebble templates.
Synopsis
This step processes input with the Pebble templating engine.
| Input port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ |
| Option name | Type | Default value | Required |
|---|---|---|---|
| context | map(xs:string,item()) | ✔ | |
| autoEscaping | xs:boolean | true() | |
| defaultEscapingStrategy | xs:string? | () | |
| defaultLocale | xs:string? | () | |
| literalDecimalTreatedAsInteger | xs:boolean? | () | |
| literalNumbersAsBigDecimals | xs:boolean? | () | |
| maxRenderedSize | xs:integer? | () | |
| newlineTrimming | xs:boolean | true() | |
| prefix | xs:string? | () | |
| strictVariables | xs:boolean | false() |
<p:import href="https://xmlcalabash.com/ext/library/pebble.xpl"/>Declaration
1 |<p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
| xmlns:p="http://www.w3.org/ns/xproc"
| type="cx:pebble">
| <p:input port="source"/>
5 | <p:output port="result"/>
| <p:option name="context" as="map(xs:string,item())" required="true"/>
| <p:option name="prefix" as="xs:string?"/>
| <p:option name="defaultLocale" as="xs:string?"/>
| <p:option name="strictVariables" as="xs:boolean" select="false()"/>
10 | <p:option name="literalDecimalTreatedAsInteger" as="xs:boolean?"/>
| <p:option name="literalNumbersAsBigDecimals" as="xs:boolean?"/>
| <p:option name="maxRenderedSize" as="xs:integer?"/>
| <p:option name="newlineTrimming" as="xs:boolean" select="true()"/>
| <p:option name="autoEscaping" as="xs:boolean" select="true()"/>
15 | <p:option name="defaultEscapingStrategy" as="xs:string?"/>
|</p:declare-step>Description
This step processes the input document with the Pebble templating engine. Pebble templates operate on text documents. If the source is XML, HTML, XHTML, JSON, YAML, or TOML, it is serialized, processed with Pebble, and then re-parsed.
The options are all passed to the Pebble engine.
contextThe map of name/value pairs used during expansion.
autoEscapingEscape potentially unsafe data?
defaultEscapingStrategySelect an escaping strategy:
html,js,css, orurl_param.defaultLocaleThe default locale for templates.
literalDecimalTreatedAsIntegerTreat decimals as integers (instead of longs).
literalNumbersAsBigDecimalsTreat literal numbers as big decimals.
maxRenderedSizeMaximum rendered size of the output. The step will fail if this threshold is exceeded.
newlineTrimmingBy default, the Pebble template engine trims a newline that immediately follows a Pebble tag. If this option is
false(), all newlines are preserved.prefixFilename prefix used when loading external templates.
strictVariablesIf true, reference to a variable name that doesn’t exist will cause the step to fail. If false, the reference is replaced by the empty string.
Document properties
All document properties are preserved.