Skeletons look a lot like macros (e.g.
{{foo}}
) and they behave very much like included documents
(using the #INC command), but they are expanded before actually parsing
the input, i.e. they provide some kind of pre-processor
macro expansion facility.
I order to use a skeleton you have to create a file
or (this one will be preferred if it exists)
and enable the skeleton on the command line by using the
--skeleton
command line option.
Some skeletons (currently only one) are “special”, i.e. not
file based but are processed by
Deplate::SkeletonExpander#skeleton_#{SPECIAL}(args)
, where
args is a hash:
Skeleton are expanded in place. I.e. the first line of the expansion text is inserted right where the skeleton marker appears in the text. If the expansion begins with an element(a command, a region etc.), the first character in the file should be a newline.
Skeletons are handled like templates (see 5.5.2). This means:
{arg: which} foo is {arg: @body}.
Input:
Bla bla. {{foo which=This: bar}} Bla bla.
yields:
Bla bla. This foo is bar. Bla bla.
deplate.rc/skeletons/bar.html:
\#Native <<{{id: bar.form}} <form action="" method="get"> <p>Name: <input name="name" type="text" size="30" maxlength="30" value="{arg: name}"/> </p> <p> <button name="submit" value="1" type="submit">Send</button> </p> </form> {{id: bar.form}}
Name :: {arg: name}
Input:
Bla bla. {{bar name=Io mio}} Bla bla.
yields:
Bla bla.
Bla bla.