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 634: 44d651b498d4
child 636: 9ab5110ba927
     1.1--- a/sites/werc.cat-v.org/docs/rc_template_lang.md	Mon May 24 23:35:08 2010 +0000
     1.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3@@ -1,46 +0,0 @@
     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-