source: project/wiki/wiki-syntax-chicken @ 8607

Last change on this file since 8607 was 8607, checked in by azul, 12 years ago

Changes applied for azul (193.142.125.1) through svnwiki:

Fix.

File size: 2.0 KB
Line 
1== Introduction
2
3This page describes the syntax that will be implemented for the Chicken wiki.
4It is important to note that this is not currently supported, but it will be
5soon (nag [[Alejandro Forero Cuervo]] otherwise).
6
7== Tags for procedure-like definitions
8
9We will add support for the following tags:
10
11* {{procedure}}
12* {{macro}}
13
14Each of these should be used as follows:
15
16 <nowiki>&lt;procedure>(string-append a b ...)&lt;/procedure></nowiki>
17
18This will be rendered as follows (with some divs and spans for easy CSSing):
19
20[procedure] {{('''string-append''' a b ...)}}
21
22== Tags for other definitions
23
24The following tags will also be supported:
25
26* {{read}}
27* {{parameter}}
28* {{record}}
29* {{string}}
30* {{class}}
31* {{method}}
32
33They should be used as follows:
34
35 <nowiki>&lt;string>doctype:xhtml-1.0-strict&lt;/string></nowiki>
36
37They will be rendered as follows:
38
39[string] {{'''doctype:xhtml-1.0-strict'''}}
40
41== Tags for examples
42
43If you want to include examples, use the following code:
44
45 <nowiki>
46 &lt;example>
47 &lt;expr>(string-append "foo" "bar")&lt;/expr>
48 &lt;result>"foobar"<&lt;result>
49 &lt;/example>
50 </nowiki>
51
52If the example shows some interaction, use this:
53
54 <nowiki>
55 &lt;example>
56 &lt;expr>(prompt-for-number-and-show-factorial)&lt;/expr>
57 &lt;output>Enter a number:&lt;/output>
58 &lt;input>4&lt;/input>
59 &lt;output>24&lt;/output>
60 &lt;result>24&lt;/result>
61 &lt;/example>
62 </nowiki>
63
64If the result of the evaluation is not specified, omit the <nowiki>&lt;result></nowiki> part.
65
66If the example requires some set up to take place before the actual code,
67please add an <nowiki>&lt;init></nowiki> section:
68
69 <nowiki>
70 &lt;example>
71 &lt;init>(use format-modular)&lt;/init>
72 &lt;expr>(format #t "Objs: ~A~%" 24)&lt;/expr>
73 &lt;output>Objs: 24
74 &lt;/output>
75 &lt;/example>
76 </nowiki>
77
78The code in the <nowiki>&lt;init></nowiki> section will probably not be shown to the users unless the explicitly ask for it (ie. will be hidden with JavaScript, or shown with less emphasis than the actual code).
Note: See TracBrowser for help on using the repository browser.