This page explains by example the TWiki feature proposal
TWiki:Codev.DocumentedDefaultParameterValuesForInclude
... it should eventually be moved to
IncludeTopicsAndWebPages
Disclaimer:
4. Use as a macro
We have created the macro topic
SampleMacroDemonstratingIncludeParams and will use it as a macro below.
First try to
view the topic raw to find out what it does.
Especially note how we use the
%debug% variable to display/hide parameter-table output
We try to invocate the macro twice.
4.a Macro invocation A
We write
%INCLUDE{"SampleMacroDemonstratingIncludeParams"}%
And get...
Macro help:
Usage:
- Order a brunch by writiting
%INCLUDE{"Codev.SampleMacroDemonstratingIncludeParams" ...}%
- Fill in parameters as you please, c.f.table below
%INCLUDEPARAMS{
debug = "no ::doc:: Legal values:
yes or
no / Show \"Macro Help\" in =%INCLUDINGTOPIC%="
size = "medium ::doc:: Legal values:
small ,
medium or
large / Size of brunch"
egg = "boiled ::doc:: Legal values:
boiled,
srambled or
porched / How do you want your egg?"
}%
Order:
- A %size% brunch with %egg% eggs.
4.b Macro invocation B
We write
%INCLUDE{"SampleMacroDemonstratingIncludeParams" debug="yes" size="big" egg="porched" }%
And get...
Macro help:
Usage:
- Order a brunch by writiting
%INCLUDE{"Codev.SampleMacroDemonstratingIncludeParams" ...}%
- Fill in parameters as you please, c.f.table below
%INCLUDEPARAMS{
debug = "no ::doc:: Legal values:
yes or
no / Show \"Macro Help\" in =%INCLUDINGTOPIC%="
size = "medium ::doc:: Legal values:
small ,
medium or
large / Size of brunch"
egg = "boiled ::doc:: Legal values:
boiled,
srambled or
porched / How do you want your egg?"
}%
Order:
- A big brunch with porched eggs.