5.5.2.1 name="..." attribute

Macros can be defined to accept multiple arguments. The name attribute is used to retrieve named arguments. When invoking a macro that accepts named arguments the <al-setarg> (5.5.5) tag and name attribute are used to define the content for each named argument.

>>> import albatross
>>> ctx = albatross.SimpleContext('.')
>>> albatross.Template(ctx, '<magic>', '''
... <al-macro name="namedargs" whitespace="indent">
...  The unnamed arg (<al-usearg>) still works,
...  but we can also include named arguments (<al-usearg name="arg1">)
... </al-macro>
... ''').to_html(ctx)
>>> albatross.Template(ctx, '<magic>', '''
... <al-expand name="namedargs">
...  unnamed arg<al-setarg name="arg1">
...  named arg: arg1</al-setarg>
... </al-expand>
... ''').to_html(ctx)
>>> ctx.flush_content()
 The unnamed arg (unnamed arg) still works,
 but we can also include named arguments (named arg: arg1)