changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > werc / sites/werc.cat-v.org/docs/rc-template-lang.md

revision 635: dd58ad29ffbf
parent 594: a150ab6df4e2
child 638: 246f5fab8f92
     1.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2+++ b/sites/werc.cat-v.org/docs/rc-template-lang.md	Sun May 30 18:04:04 2010 +0000
     1.3@@ -0,0 +1,46 @@
     1.4+The Rc Template Language
     1.5+========================
     1.6+
     1.7+Implemented by Kris, thanks!
     1.8+
     1.9+Basic syntax:
    1.10+
    1.11+* Lines starting with % are executed as rc commands, the resulting output is inserted in the document.
    1.12+* use %{ and %} to delimit multi line sections of rc code (note the lack of space between % and { or }!
    1.13+* To 'inline' the value of an environment variable use `%($my_var%)`
    1.14+
    1.15+That is basically it!
    1.16+
    1.17+For further documentation on rc see:
    1.18+
    1.19+* [The rc(1) man page for Plan 9](http://man.cat-v.org/plan_9/1/rc).
    1.20+* [The rc shell paper by Tom Duff](http://rc.cat-v.org).
    1.21+
    1.22+
    1.23+Examples
    1.24+--------
    1.25+
    1.26+Loops
    1.27+
    1.28+    <ul>
    1.29+    % for(i in a b c) {
    1.30+    %   echo '<li>'$i'</li>'
    1.31+    % }
    1.32+    </uL>
    1.33+ 
    1.34+Is equivalent to: 
    1.35+
    1.36+    <ul>
    1.37+    % for(i in a b c) {
    1.38+    <li>%($i%)</li>
    1.39+    % }
    1.40+    </uL>
    1.41+
    1.42+and results in this output:
    1.43+
    1.44+    <ul>
    1.45+    <li>a</li>
    1.46+    <li>b</li>
    1.47+    <li>c</li>
    1.48+    </ul>
    1.49+