changelog shortlog tags branches changeset files revisions annotate raw help

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

changeset 635: dd58ad29ffbf
parent: sites/werc.cat-v.org/docs/rc_template_lang.md@a150ab6df4e2
child: 246f5fab8f92
author: Uriel <u@berlinblue.org>
date: Sun, 30 May 2010 18:04:04 +0000
permissions: -rw-r--r--
description: Replace '_' in paths in werc's docs section with '-', and set up apropriate redirects to avoid broken links.
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 for 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 Is equivalent to:
32 
33  <ul>
34  % for(i in a b c) {
35  <li>%($i%)</li>
36  % }
37  </uL>
38 
39 and results in this output:
40 
41  <ul>
42  <li>a</li>
43  <li>b</li>
44  <li>c</li>
45  </ul>
46