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

Last change on this file since 8604 was 8604, checked in by azul, 13 years ago

Changes applied for azul (193.142.125.1) through svnwiki:

Tweaks

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