km
translates only keys ${}
and macros and &{}
in the text, everything else is passed through. This special signature enables existing HTML to be marked up with key substitutions and macro execution. Compare to raw which does no translation whatsoever.
Here's a contrived example:
This is a test of the km
signature. Here is a link "p":../p/index.html using a define to insert a macro which is then exececuted (one used in the building of this tree of examples). And a macro -- 14 is the length of the "test" key's value -- that demonstrates the ordering of key sub and macro exec. No other translation is done.
You have an existing files you want to use in different contexts — websites for different clients or different documents. With keys and macros it can be parameterized. Then with different key/macro sets you can produce different versions of the files — simply put a km. {{
line at the top of each file and a }}
line at the bottom. There are other ways to accomplished the same effect but km
avoids all the overhead of processing other translation functions.
km, key/macro @km@ translates only keys @${}@ and macros and @&{}@ in the text, everything else is passed through. This special signature enables existing HTML to be marked up with key substitutions and macro execution. Compare to &{link:raw} which does no translation whatsoever. example. {{ Here's a contrived example: define. test This is a test define. link &{link:p} km. <p style="background:#eee">${test} of the <code>km</code> signature. Here is a link ${link} using a define to insert a macro which is then exececuted (one used in the building of this tree of examples). And a macro -- &{"${test}".length()} is the length of the "test" key's value -- that demonstrates the ordering of key sub and macro exec. No other translation is done.</p> h2. consider You have an existing files you want to use in different contexts -- websites for different clients or different documents. With keys and macros it can be parameterized. Then with different key/macro sets you can produce different versions of the files -- simply put a @km. {{@ line at the top of each file and a @}}@ line at the bottom. There are other ways to accomplished the same effect but @km@ avoids all the overhead of processing other translation functions. }}
Long lines are wrapped in this listing.
Use your web browser's "View Page Source" feature to examine the HTML