source: project/wiki/wiki-syntax @ 15606

Last change on this file since 15606 was 15606, checked in by svnwiki, 11 years ago

Changes applied for Anonymous (62.80.184.178) through svnwiki:

File size: 9.8 KB
Line 
1[[tags:wiki syntax]]
2[[toc:]]
3
4== Introduction
5
6This document describes the syntax used by [[http://wiki.freaks-unidos.net/svnwiki|svnwiki]] to represent
7contents in a wiki.
8
9If 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
15To create a paragraph simply enter the text. You can place a single
16newline anywhere in your paragraph and it will have no effect.
17
18To split a paragraph use two consecutive newlines (an empty line).
19
20The 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
30To 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
37If you use two equal signs, you will create a top-level title.  The more
38equal signs you use, the less important your title will be.
39
40An alternative option for creating titles is using ''<nowiki>&lt;h1&gt;</nowiki>''
41''<nowiki>&lt;h2&gt;</nowiki>'', ''<nowiki>&lt;h3&gt;</nowiki>'',
42''<nowiki>&lt;h4&gt;</nowiki>'', ''<nowiki>&lt;h5&gt;</nowiki>'' and
43''<nowiki>&lt;h6&gt;</nowiki>'' tags.
44There is one important difference with the
45previous syntax: tags created in this manner will not be included in the
46articles' Table of Contents.  For this reason, you are encouraged not
47to use this syntax unless you have specific reasons.
48
49=== Font styles (bold, italics, technical)
50
51To create '''bold''' text, use three apostrophes ('), as in: ''<nowiki>'''bold'''</nowiki>''.  Use two for ''italics'': ''<nowiki>''italics''</nowiki>''.  For {{type-written
52text}}, which is useful for technical documentation, use
53this syntax: ''<nowiki>{{text}}</nowiki>''.
54
55Related with type-written text, you can mark entire paragraphs
56to be shown in type-written text.  This is used for lines that
57correspond to program's output or commands that a user should
58enter.  To active this all you need to do is start each line in
59your paragraph with a space.  Paragraphs written in this manner
60are 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
70To increase or decrease the size of the text you can wrap it around
71a pair of ''<nowiki>&lt;big&gt;...&lt;/big&gt;</nowiki>'' and
72''<nowiki>&lt;small&gt;...&lt;/small&gt;</nowiki>'' tags respectively.
73
74Example:
75
76 <nowiki>&lt;big&gt;This text is big...&lt;/big&gt;</nowiki>
77
78 <nowiki>&lt;small&gt;... and this is small.&lt;/small&gt;</nowiki>
79
80This 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
89To center text you can wrap multiple paragraphs (and lists, titles, etc.) with a pair of ''<nowiki>&lt;center&gt;...&lt;/center&gt;</nowiki>'' tags, as in:
90
91 <center>
92 some text
93 * item
94 * another
95 </center>
96
97This will be shown as:
98
99<center>
100some text
101* item
102* another
103</center>
104
105=== Special characters
106
107svnwiki automatically replaces certain sequences of characters with HTML
108entities that browsers display better.  The following is the list of sequences:
109
110 <nowiki>(R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >></nowiki>
111
112These sequences are replaced with these characters respectively:
113(R) (C) <- <-> -> <= <=> => -- --- << 1/4 1/2 3/4 >>
114
115 
116=== Quotes
117
118If you want to make quotes, you can start your lines with ''>'' (the
119standard character for email quotation).  Alternatively, you can
120surround it with <nowiki>&lt;blockquote&gt; ... &lt;/blockquote&gt;</nowiki>
121
122This 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
135If you want to show the table of contents of an article, use the following
136code:
137
138 <nowiki>[[toc:]]</nowiki>
139
140This will be replaced with the table of contents.  You can see an example at
141the beginning of this page.
142
143=== Lists of items
144
145You can create lists of bullets or numbers by starting your lines with
146asterisks 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 numbered sub sub item
154 * The last item
155
156The 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 numbered sub sub item
164* The last item
165
166As you can see, you can mix bullets and numbered lists any way you want.
167
168=== Lists of Definitions
169
170You can create a list of definitions by using multiple lines with the
171following syntax:
172
173 ; ''[[http://www.besttermpapers.org/|TERM]]'' : ''DEFINITION''
174
175This is useful to give a list of terms along with their respective
176definitions.
177
178Example:
179
180 ; Lassie : A very intelligent dog.
181 ; Garfield : A pessimistic cat.
182 ; Tux : A fearsome pinguin.
183
184This 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
192You can create a table using the standard HTML syntax, based on the
193<tt><nowiki>&lt;table&gt;</nowiki></tt>,
194<tt><nowiki>&lt;tr&gt;</nowiki></tt> and
195<tt><nowiki>&lt;td&gt;</nowiki></tt> tags.
196
197Example:
198
199 <nowiki>&lt;table&gt;</nowiki>
200 <nowiki>&lt;tr&gt;&lt;th&gt;Country&lt;/th&gt;&lt;th&gt;Number of cities&lt;/th&gt;&lt;/tr&gt;</nowiki>
201 <nowiki>&lt;tr&gt;&lt;td&gt;Colombia&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;</nowiki>
202 <nowiki>&lt;tr&gt;&lt;td&gt;Argentina&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;</nowiki>
203 <nowiki>&lt;tr&gt;&lt;td&gt;Brasil&lt;/td&gt;&lt;td&gt;31&lt;/td&gt;&lt;/tr&gt;</nowiki>
204 <nowiki>&lt;/table&gt;</nowiki>
205
206This 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
215Currently it is not possible to include parameters in any of the above tags;
216this will probably be fixed in a future release.
217
218=== Horizontal dividing line
219
220You can include an horizontal dividing line with the followking markup:
221
222 ----
223
224This is shown as:
225
226----
227
228== Creating Links
229
230To create links use ''<nowiki>[[dst]]</nowiki>'', where ''dst'' is the
231link target.  You can use relative or absolute URLs.
232
233If 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
237Here 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
244To include images in your articles use the following text:
245
246 ''<nowiki>[[image:URL|ALT]]</nowiki>''
247
248Here you'll need to replace ''URL'' with the URL of your image (which can
249be absolute or relative) and ''ALT'' with a simple description of the image.
250
251Example:
252 ''<nowiki>[[image:http://azul.freaks-unidos.net/files/svnwiki-small.png|Image]]</nowiki>''
253
254Renders 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
262You can embbed code or information in many file formats or programming languages;
263Svnwiki will use [[http://www.codento.com/people/mtr/genscript/|GNU Enscript]] to highlight it.
264Use the <nowiki>&lt;enscript&gt;</nowiki> tag and pass the programming language or file format as the highlight parameter.
265
266For example,
267
268 <nowiki>&lt;enscript highlight=c&gt;</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>&lt;/enscript&gt;</nowiki>
280
281is shown as:
282
283<enscript highlight=c>
284static void
285pinst_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
296Note that in order for this to work you'll need to have GNU Enscript installed.
297If you don't, the information will be shown with no coloring.
298
299The 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
303It is possible to embbed entire programs in
304the Scheme programming language inside the wiki pages.
305svnwiki will execute it securely (in a safe environment)
306and replace it with whatever output it produces.
307
308For example, you could include code that prints some numbers:
309
310 <nowiki>&lt;scheme&gt;</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>&lt;/scheme&gt;</nowiki>
317
318This 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
328Note that the output of the Scheme code will be included literally
329in the page (so you can output HTML tags directly).
330
331=== Literal code
332
333To include something in a page literally (preventing svnwiki to convert it
334from wiki to HTML), place it inside a <nowiki>&lt;nowiki&gt; ... &lt;/nowiki&gt;</nowiki> pair.
335
336----
337
338If you have suggestions to improve Svnwiki, please [[http://wiki.freaks-unidos.net/svnwiki-suggestions|let us know]].
Note: See TracBrowser for help on using the repository browser.