Formats the ---…--- frontmatter block of a Triplate template from its parsed AST:
a canonical params { … } / example id { … } layout, one declaration per line at
the requested indent, with # comments preserved and re-indented in place.
The frontmatter is Triplate's own syntax (not RDF), so it is reprinted from
triplate's compiled AST rather than the host token stream. The formatter never
corrupts: on any failure — including if the reprint would not parse back — it returns
the original frontmatter verbatim.
Returns the formatted ---…--- block for templateText (everything up to and
including the closing --- line), or the original frontmatter unchanged if it
cannot be safely reformatted. Returns '' when there is no frontmatter.
Formats the
---…---frontmatter block of a Triplate template from its parsed AST: a canonicalparams { … }/example id { … }layout, one declaration per line at the requested indent, with#comments preserved and re-indented in place.The frontmatter is Triplate's own syntax (not RDF), so it is reprinted from
triplate's compiled AST rather than the host token stream. The formatter never corrupts: on any failure — including if the reprint would not parse back — it returns the original frontmatter verbatim.