1 | [[tags:wiki syntax]] |
---|
2 | [[toc:]] |
---|
3 | |
---|
4 | == Introduction |
---|
5 | |
---|
6 | This document describes the syntax used by [[http://wiki.freaks-unidos.net/svnwiki|svnwiki]] to represent |
---|
7 | contents in a wiki. |
---|
8 | |
---|
9 | If you have suggestions to improve svnwiki, please [[http://wiki.freaks-unidos.net/svnwiki-suggestions|let us know]]. |
---|
10 | |
---|
11 | == Text Formatting |
---|
12 | |
---|
13 | === Creating a paragraph |
---|
14 | |
---|
15 | To create a paragraph simply enter the text. You can place a single |
---|
16 | newline anywhere in your paragraph and it will have no effect. |
---|
17 | |
---|
18 | To split a paragraph use two consecutive newlines (an empty line). |
---|
19 | |
---|
20 | The above two paragraphs could have been written as: |
---|
21 | |
---|
22 | To create a paragraph simply enter the text. |
---|
23 | You can place a single newline anywhere in |
---|
24 | your paragraph and it will have no effect. |
---|
25 | |
---|
26 | To split a paragraph use two consecutive newlines (an empty line). |
---|
27 | |
---|
28 | === Creating titles |
---|
29 | |
---|
30 | To create a title, use a line starting with two, three, four or five equal signs: |
---|
31 | |
---|
32 | == Title Name |
---|
33 | === Sub-title Name |
---|
34 | ==== Sub-sub-title Name |
---|
35 | ===== Sub-sub-sub-title Name |
---|
36 | |
---|
37 | If you use two equal signs, you will create a top-level title. The more |
---|
38 | equal signs you use, the less important your title will be. |
---|
39 | |
---|
40 | An alternative option for creating titles is using ''<nowiki><h1></nowiki>'' |
---|
41 | ''<nowiki><h2></nowiki>'', ''<nowiki><h3></nowiki>'', |
---|
42 | ''<nowiki><h4></nowiki>'', ''<nowiki><h5></nowiki>'' and |
---|
43 | ''<nowiki><h6></nowiki>'' tags. |
---|
44 | There is one important difference with the |
---|
45 | previous syntax: tags created in this manner will not be included in the |
---|
46 | articles' Table of Contents. For this reason, you are encouraged not |
---|
47 | to use this syntax unless you have specific reasons. |
---|
48 | |
---|
49 | === Font styles (bold, italics, technical) |
---|
50 | |
---|
51 | To create '''bold''' text, use three apostrophes ('), as in: ''<nowiki>'''bold'''</nowiki>''. Use two for ''italics'': ''<nowiki>''italics''</nowiki>''. For {{type-written |
---|
52 | text}}, which is useful for technical documentation, use |
---|
53 | this syntax: ''<nowiki>{{text}}</nowiki>''. |
---|
54 | |
---|
55 | Related with type-written text, you can mark entire paragraphs |
---|
56 | to be shown in type-written text. This is used for lines that |
---|
57 | correspond to program's output or commands that a user should |
---|
58 | enter. To active this all you need to do is start each line in |
---|
59 | your paragraph with a space. Paragraphs written in this manner |
---|
60 | are shown as follows: |
---|
61 | |
---|
62 | > uptime |
---|
63 | 23:04:03 up 14:18, 1 user, load average: 0.02, 0.06, 0.18 |
---|
64 | > uname -a |
---|
65 | Linux azul 2.6.10 #1 Mon Feb 7 00:20:16 COT 2005 i686 GNU/Linux |
---|
66 | > |
---|
67 | |
---|
68 | === Font size (big, small) |
---|
69 | |
---|
70 | To increase or decrease the size of the text you can wrap it around |
---|
71 | a pair of ''<nowiki><big>...</big></nowiki>'' and |
---|
72 | ''<nowiki><small>...</small></nowiki>'' tags respectively. |
---|
73 | |
---|
74 | Example: |
---|
75 | |
---|
76 | <nowiki><big>This text is big...</big></nowiki> |
---|
77 | |
---|
78 | <nowiki><small>... and this is small.</small></nowiki> |
---|
79 | |
---|
80 | This is shown as: |
---|
81 | |
---|
82 | <big>This text is big...</big> |
---|
83 | |
---|
84 | <small>... and this is small.</small> |
---|
85 | |
---|
86 | |
---|
87 | === Centering text |
---|
88 | |
---|
89 | To center text you can wrap multiple paragraphs (and lists, titles, etc.) with a pair of ''<nowiki><center>...</center></nowiki>'' tags, as in: |
---|
90 | |
---|
91 | <center> |
---|
92 | some text |
---|
93 | * item |
---|
94 | * another |
---|
95 | </center> |
---|
96 | |
---|
97 | This will be shown as: |
---|
98 | |
---|
99 | <center> |
---|
100 | some text |
---|
101 | * item |
---|
102 | * another |
---|
103 | </center> |
---|
104 | |
---|
105 | === Special characters |
---|
106 | |
---|
107 | svnwiki automatically replaces certain sequences of characters with HTML |
---|
108 | entities that browsers display better. The following is the list of sequences: |
---|
109 | |
---|
110 | <nowiki>(R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >></nowiki> |
---|
111 | |
---|
112 | These sequences are replaced with these characters respectively: |
---|
113 | (R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >> |
---|
114 | |
---|
115 | |
---|
116 | === Quotes |
---|
117 | |
---|
118 | If you want to make quotes, you can start your lines with ''>'' (the |
---|
119 | standard character for email quotation). Alternatively, you can |
---|
120 | surround it with <nowiki><blockquote> ... </blockquote></nowiki> |
---|
121 | |
---|
122 | This text will be show as: |
---|
123 | |
---|
124 | > I am enough of an artist to draw freely upon my imagination. |
---|
125 | > Imagination is more important than knowledge. |
---|
126 | > Knowledge is limited. |
---|
127 | > Imagination encircles the world. |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | == Organizing your article (Table of contents, lists, tables, horizontal lines) |
---|
132 | |
---|
133 | === Table of Contents |
---|
134 | |
---|
135 | If you want to show the table of contents of an article, use the following |
---|
136 | code: |
---|
137 | |
---|
138 | <nowiki>[[toc:]]</nowiki> |
---|
139 | |
---|
140 | This will be replaced with the table of contents. You can see an example at |
---|
141 | the beginning of this page. |
---|
142 | |
---|
143 | === Lists of items |
---|
144 | |
---|
145 | You can create lists of bullets or numbers by starting your lines with |
---|
146 | asterisks or number signs: |
---|
147 | |
---|
148 | * Some item |
---|
149 | * Another item |
---|
150 | ** A sub item |
---|
151 | ** Another sub item |
---|
152 | **# A numbered sub sub item |
---|
153 | **# Another numberd sub sub item |
---|
154 | * The last item |
---|
155 | |
---|
156 | The above list will be rendered as: |
---|
157 | |
---|
158 | * Some item |
---|
159 | * Another item |
---|
160 | ** A sub item |
---|
161 | ** Another sub item |
---|
162 | **# A numbered sub sub item |
---|
163 | **# Another numberd sub sub item |
---|
164 | * The last item |
---|
165 | |
---|
166 | As you can see, you can mix bullets and numbers lists any way you want. |
---|
167 | |
---|
168 | === Lists of Definitions |
---|
169 | |
---|
170 | You can create a list of definitions by using multiple lines with the |
---|
171 | following syntax: |
---|
172 | |
---|
173 | ; ''TERM'' : ''DEFINITION'' |
---|
174 | |
---|
175 | This is useful to give a list of terms along with their respective |
---|
176 | definitions. |
---|
177 | |
---|
178 | Example: |
---|
179 | |
---|
180 | ; Lassie : A very intelligent dog. |
---|
181 | ; Garfield : A pessimistic cat. |
---|
182 | ; Tux : A fearsome pinguin. |
---|
183 | |
---|
184 | This list is shown as: |
---|
185 | |
---|
186 | ; Lassie : A very intelligent dog. |
---|
187 | ; Garfield : A pessimistic cat. |
---|
188 | ; Tux : A fearsome pinguin. |
---|
189 | |
---|
190 | === Using tables |
---|
191 | |
---|
192 | You can create a table using the standard HTML syntax, based on the |
---|
193 | <tt><nowiki><table></nowiki></tt>, |
---|
194 | <tt><nowiki><tr></nowiki></tt> and |
---|
195 | <tt><nowiki><td></nowiki></tt> tags. |
---|
196 | |
---|
197 | Example: |
---|
198 | |
---|
199 | <nowiki><table></nowiki> |
---|
200 | <nowiki><tr><th>Country</th><th>Number of cities</th></tr></nowiki> |
---|
201 | <nowiki><tr><td>Colombia</td><td>16</td></tr></nowiki> |
---|
202 | <nowiki><tr><td>Argentina</td><td>16</td></tr></nowiki> |
---|
203 | <nowiki><tr><td>Brasil</td><td>31</td></tr></nowiki> |
---|
204 | <nowiki></table></nowiki> |
---|
205 | |
---|
206 | This is shown as: |
---|
207 | |
---|
208 | <table> |
---|
209 | <tr><th>Country</th><th>Number of cities</th></tr> |
---|
210 | <tr><td>Colombia</td><td>17</td></tr> |
---|
211 | <tr><td>Argentina</td><td>12</td></tr> |
---|
212 | <tr><td>Brasil</td><td>31</td></tr> |
---|
213 | </table> |
---|
214 | |
---|
215 | Currently it is not possible to include parameters in any of the above tags; |
---|
216 | this will probably be fixed in a future release. |
---|
217 | |
---|
218 | === Horizontal dividing line |
---|
219 | |
---|
220 | You can include an horizontal dividing line with the followking markup: |
---|
221 | |
---|
222 | ---- |
---|
223 | |
---|
224 | This is shown as: |
---|
225 | |
---|
226 | ---- |
---|
227 | |
---|
228 | == Creating Links |
---|
229 | |
---|
230 | To create links use ''<nowiki>[[dst]]</nowiki>'', where ''dst'' is the |
---|
231 | link target. You can use relative or absolute URLs. |
---|
232 | |
---|
233 | If you want your link to display a text other than its target, use |
---|
234 | ''<nowiki>[[dst|Some text]]</nowiki>''. This will be shown as: |
---|
235 | [[dst|Some text]]. |
---|
236 | |
---|
237 | Here are some examples: |
---|
238 | |
---|
239 | * <tt><nowiki>[[http://wiki.freaks-unidos.net/]]</nowiki></tt> |
---|
240 | * <tt><nowiki>[[default|Home Page]]</nowiki></tt> |
---|
241 | |
---|
242 | == Including Images |
---|
243 | |
---|
244 | To include images in your articles use the following text: |
---|
245 | |
---|
246 | ''<nowiki>[[image:URL|ALT]]</nowiki>'' |
---|
247 | |
---|
248 | Here you'll need to replace ''URL'' with the URL of your image (which can |
---|
249 | be absolute or relative) and ''ALT'' with a simple description of the image. |
---|
250 | |
---|
251 | Example: |
---|
252 | ''<nowiki>[[image:http://azul.freaks-unidos.net/files/svnwiki-small.png|Image]]</nowiki>'' |
---|
253 | |
---|
254 | Renders this: |
---|
255 | |
---|
256 | [[image:http://azul.freaks-unidos.net/files/svnwiki-small.png|Image]] |
---|
257 | |
---|
258 | == Svnwiki and programming languages |
---|
259 | |
---|
260 | === Syntax coloring |
---|
261 | |
---|
262 | You can embbed code or information in many file formats or programming languages; |
---|
263 | Svnwiki will use [[http://www.codento.com/people/mtr/genscript/|GNU Enscript]] to highlight it. |
---|
264 | Use the <nowiki><enscript></nowiki> tag and pass the programming language or file format as the highlight parameter. |
---|
265 | |
---|
266 | For example, |
---|
267 | |
---|
268 | <nowiki><enscript highlight=c></nowiki> |
---|
269 | static void |
---|
270 | pinst_check () |
---|
271 | { |
---|
272 | pid_t pinst = pinst_find(); |
---|
273 | if (pinst != -1 && kill(pinst, 0) != -1) |
---|
274 | printf("%s: server alive (%d)\n", program_name, pinst); |
---|
275 | else |
---|
276 | printf("%s: server is not running\n", program_name); |
---|
277 | exit(EXIT_SUCCESS); |
---|
278 | } |
---|
279 | <nowiki></enscript></nowiki> |
---|
280 | |
---|
281 | is shown as: |
---|
282 | |
---|
283 | <enscript highlight=c> |
---|
284 | static void |
---|
285 | pinst_check () |
---|
286 | { |
---|
287 | pid_t pinst = pinst_find(); |
---|
288 | if (pinst != -1 && kill(pinst, 0) != -1) |
---|
289 | printf("%s: server alive (%d)\n", program_name, pinst); |
---|
290 | else |
---|
291 | printf("%s: server is not running\n", program_name); |
---|
292 | exit(EXIT_SUCCESS); |
---|
293 | } |
---|
294 | </enscript> |
---|
295 | |
---|
296 | Note that in order for this to work you'll need to have GNU Enscript installed. |
---|
297 | If you don't, the information will be shown with no coloring. |
---|
298 | |
---|
299 | The following languages are supported: ada asm awk bash c changelog cpp csh delphi diff diffs diffu dylan eiffel elisp erlang forth fortran fortran_pp haskell html icon idl inf java javascript ksh lua m4 mail makefile matlab nroff oberon2 objc outline oz pascal perl postscript pyrex python rfc scheme sh skill smalltalk sml sql states synopsys tcl tcsh tex vba verilog vhdl vrml wmlscript zsh. |
---|
300 | |
---|
301 | === Embedding Scheme code |
---|
302 | |
---|
303 | It is possible to embbed entire programs in |
---|
304 | the Scheme programming language inside the wiki pages. |
---|
305 | svnwiki will execute it securely (in a safe environment) |
---|
306 | and replace it with whatever output it produces. |
---|
307 | |
---|
308 | For example, you could include code that prints some numbers: |
---|
309 | |
---|
310 | <nowiki><scheme></nowiki> |
---|
311 | <enscript highlight=scheme> |
---|
312 | (let loop ((a 0) (b 1) (i 0)) |
---|
313 | (cond |
---|
314 | ((< i 10) (format #t "<p>~A: ~A~%" i a) (loop b (+ a b) (+ i 1))))) |
---|
315 | </enscript> |
---|
316 | <nowiki></scheme></nowiki> |
---|
317 | |
---|
318 | This code would get replaced with the following: |
---|
319 | |
---|
320 | <scheme> |
---|
321 | (let loop ((a 0) (b 1) (i 0)) |
---|
322 | (cond |
---|
323 | ((< i 10) |
---|
324 | (format #t "<p>~A: ~A~%" i a) |
---|
325 | (loop b (+ a b) (+ i 1))))) |
---|
326 | </scheme> |
---|
327 | |
---|
328 | Note that the output of the Scheme code will be included literally |
---|
329 | in the page (so you can output HTML tags directly). |
---|
330 | |
---|
331 | === Literal code |
---|
332 | |
---|
333 | To include something in a page literally (preventing svnwiki to convert it |
---|
334 | from wiki to HTML), place it inside a <nowiki><nowiki> ... </nowiki></nowiki> pair. |
---|
335 | |
---|
336 | ---- |
---|
337 | |
---|
338 | If you have suggestions to improve Svnwiki, please [[http://wiki.freaks-unidos.net/svnwiki-suggestions|let us know]]. |
---|