1 | == Introduction |
---|
2 | |
---|
3 | This page describes the syntax that will be implemented for the Chicken wiki. |
---|
4 | It is important to note that this is not currently supported, but it will be |
---|
5 | soon (nag [[Alejandro Forero Cuervo]] otherwise). |
---|
6 | |
---|
7 | == Tags for procedure-like definitions |
---|
8 | |
---|
9 | We will add support for the following tags: |
---|
10 | |
---|
11 | * {{procedure}} |
---|
12 | * {{macro}} |
---|
13 | |
---|
14 | Each of these should be used as follows: |
---|
15 | |
---|
16 | <nowiki><procedure>(string-append a b ...)</procedure></nowiki> |
---|
17 | |
---|
18 | This 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 | |
---|
24 | The following tags will also be supported: |
---|
25 | |
---|
26 | * {{read}} |
---|
27 | * {{parameter}} |
---|
28 | * {{record}} |
---|
29 | * {{string}} |
---|
30 | * {{class}} |
---|
31 | * {{method}} |
---|
32 | * {{constant}} |
---|
33 | |
---|
34 | They should be used as follows: |
---|
35 | |
---|
36 | <nowiki><string>doctype:xhtml-1.0-strict</string></nowiki> |
---|
37 | |
---|
38 | They will be rendered as follows: |
---|
39 | |
---|
40 | [string] {{'''doctype:xhtml-1.0-strict'''}} |
---|
41 | |
---|
42 | == Tags for examples |
---|
43 | |
---|
44 | If you want to include examples, use the following code: |
---|
45 | |
---|
46 | <nowiki> |
---|
47 | <example> |
---|
48 | <expr>(string-append "foo" "bar")</expr> |
---|
49 | <result>"foobar"</result> |
---|
50 | </example> |
---|
51 | </nowiki> |
---|
52 | |
---|
53 | If your example has more than one line, just put them within ''one'' |
---|
54 | {{<expr>}} tag. Do ''not'' put empty lines in an {{<example>}} tag. |
---|
55 | You can put empty lines within {{<expr>}}, though. |
---|
56 | |
---|
57 | If the example shows some interaction, use this: |
---|
58 | |
---|
59 | <nowiki> |
---|
60 | <example> |
---|
61 | <expr>(prompt-for-number-and-show-factorial)</expr> |
---|
62 | <output>Enter a number:</output> |
---|
63 | <input>4</input> |
---|
64 | <output>24</output> |
---|
65 | <result>24</result> |
---|
66 | </example> |
---|
67 | </nowiki> |
---|
68 | |
---|
69 | If the result of the evaluation is not specified, omit the <nowiki><result></nowiki> part. |
---|
70 | |
---|
71 | If the example requires some set up to take place before the actual code, |
---|
72 | please add an <nowiki><init></nowiki> section: |
---|
73 | |
---|
74 | <nowiki> |
---|
75 | <example> |
---|
76 | <init>(use format-modular)</init> |
---|
77 | <expr>(format #t "Objs: ~A~%" 24)</expr> |
---|
78 | <output>Objs: 24 |
---|
79 | </output> |
---|
80 | </example> |
---|
81 | </nowiki> |
---|
82 | |
---|
83 | The code in the <nowiki><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). |
---|
84 | |
---|
85 | We expect to automatically build a page including all the examples in the wiki, indicating whether or not they pass. |
---|