werc-1.5.0-tweaks

Tweaks for the werc website builder created by the mad architect Uriel
Log | Files | Refs | README

rc-template-lang.md (993B)


      1 The Rc Template Language
      2 ========================
      3 
      4 Implemented by Kris, thanks!
      5 
      6 Basic syntax:
      7 
      8 * Lines starting with % are executed as rc commands, the resulting output is inserted in the document.
      9 * use %{ and %} to delimit multi line sections of rc code (note the lack of space between % and { or }!
     10 * To 'inline' the value of an environment variable use `%($my_var%)`
     11 
     12 That is basically it!
     13 
     14 For further documentation on rc see:
     15 
     16 * [The rc(1) man page from Plan 9](http://man.cat-v.org/plan_9/1/rc).
     17 * [The rc shell paper by Tom Duff](http://rc.cat-v.org).
     18 
     19 
     20 Examples
     21 --------
     22 
     23 Loops
     24 
     25     <ul>
     26     % for(i in a b c) {
     27     %   echo '<li>'$i'</li>'
     28     % }
     29     </uL>
     30 
     31 Can also be writen as:
     32 
     33     <ul>
     34     %{
     35     for(i in a b c) {
     36        echo '<li>'$i'</li>'
     37     }
     38     %}
     39     </uL>
     40 
     41 and is equivalent to: 
     42 
     43     <ul>
     44     % for(i in a b c) {
     45     <li>%($i%)</li>
     46     % }
     47     </uL>
     48 
     49 All three code examples result in this output:
     50 
     51     <ul>
     52     <li>a</li>
     53     <li>b</li>
     54     <li>c</li>
     55     </ul>
     56