Extending Chloe with custom tags
Furnace framework > Furnace presentation layer > Chloe templates > Extending Chloe

Prev:Extending Chloe with custom components


Syntax for defining custom tags:
CHLOE:


A number of compiler words can be used from the CHLOE: body to emit compiled template code.

Extracting attributes from the XML tag:
required-attr ( tag name -- value )

optional-attr ( tag name -- value )

compile-attr ( value -- )


Examining tag nesting:
tag-stack


Generating code for printing strings and calling quotations:
[write] ( string -- )

[code] ( quot -- )


Generating code from child elements:
process-children ( tag quot -- )

compile-children>string ( tag -- )

compile-with-scope ( quot -- )


Examples which illustrate some of the above:
Examples of custom Chloe tags