5.4.4 <al-setarg>

The <al-setarg> tag is used pass content to a macro. All content enclosed by the tag will be passed as an argument to the macro named by the parent <al-expand> (5.4.3) tag.

The <al-setarg> tag is normally used to pass content to macros that define named arguments, but can also be used to enclose the unnamed argument.

>>> import albatross
>>> ctx = albatross.SimpleContext('.')
>>> albatross.Template(ctx, '<magic>', '''
... <al-macro name="title">
...  <title><al-usearg></title>
... </al-macro>
... ''').to_html(ctx)
>>> albatross.Template(ctx, '<magic>', '''
... <al-expand name="title">
...  <al-setarg>Lumberjack</al-setarg>
... </al-expand>''').to_html(ctx)
>>> ctx.flush_content()
<title>Lumberjack</title>
>>> albatross.Template(ctx, '<magic>', '''
... <al-expand name="title">
...  Lumberjack
... </al-expand>''').to_html(ctx)
>>> ctx.flush_content()
<title>Lumberjack
</title>



Subsections