<!--mksite:attribvars--> <!--mksite:attribvars-->
The option can be selected in the sitefile, per default we do update content prefixed with these comment variables.
input: download <a href="pkg-${varname:=current}.tar.bz2"> ! output: download <a href="pkg-Value.tar.bz2"> ! default: download <a href="pkg-current.tar.bz2"> ! input: download <a href="pkg${varname:?}.tar.bz2"> ! output: download <a href="pkgvalue.tar.bz2"> ! default: download <a href="pkg.tar.bz2"> ! input: download <a href="pkg${varname:?}.tar.bz2"> ! output: download <a href="pkg-2004.tar.bz2"> ! default: download <a href="pkg.tar.bz2"> !
This is the preferred method of choosing attribute values depending on variable settings. The value of the attribute is illegal in the source htm file which is usually not a problem. The expansion will either paste the value of the selected variable, or otherwise the default value given after the ":=" setting. The start and end stem from the curly braces, expansion text should generally be short.
The variant expansions can be selected via "?" after the
colon instead of the "=". This syntax derives directly
from shell variable name expansion which knows the two
variants as well ${varname:=default}
and
${varname:?default}
. A similar syntax was
picked up for the updatevars
expansion which updates content text intead of
choosing attribute values.
The variant expansion scheme is never using the direct expansion of expandvars which were hyphenated for toplevel variables ("$title" and "$author") and parenthesed for secondary variables ("$modified" and "$issued"). Such addon texts are never present with with attribvars. Instead they only represent the core functionality of (a) lowercasing any original value and (b) removing any markup from the original value.