1444
|
1 |
#summary The reference to the wiki syntax for the Hedgewars Knowledge Base
|
590
|
2 |
#labels Restrict-AddWikiComment-Commit
|
|
3 |
= Wiki Syntax =
|
|
4 |
<wiki:toc max_depth="2" />
|
|
5 |
|
|
6 |
= Introduction =
|
|
7 |
|
|
8 |
Each wiki page is stored in a .wiki file under the /wiki directory in
|
|
9 |
a project's repository. Each file's name is the same as the wiki page
|
|
10 |
name. And, each wiki file consists of optional pragma lines followed
|
|
11 |
by the content of the page.
|
|
12 |
|
|
13 |
= Pragmas =
|
|
14 |
|
|
15 |
Optional pragma lines provide metadata about the page and how it should be
|
|
16 |
displayed. These lines are only processed if they appear at the top of
|
|
17 |
the file. Each pragma line begins with a pound-sign (#) and the
|
|
18 |
pragma name, followed by a value.
|
|
19 |
|
|
20 |
|| *Pragma* || *Value* ||
|
|
21 |
|| #summary || One-line summary of the page ||
|
|
22 |
|| #labels || Comma-separated list of labels (filled in automatically via the web UI) ||
|
|
23 |
|
|
24 |
= Wiki-style markup =
|
|
25 |
|
|
26 |
== Paragraphs ==
|
|
27 |
|
|
28 |
Use one or more blank lines to separate paragraphs.
|
|
29 |
|
|
30 |
== Typeface ==
|
|
31 |
|
|
32 |
||* Name/Sample* || * Markup * ||
|
|
33 |
|| _italic_ || `_italic_` ||
|
|
34 |
|| *bold* || `*bold*` ||
|
|
35 |
|| `code` || {{{`code`}}} ||
|
|
36 |
|| {{{code}}} || `{{{code}}}` ||
|
|
37 |
|| ^super^script || `^super^script` ||
|
|
38 |
|| ,,sub,,script || `,,sub,,script` ||
|
|
39 |
|| ~~strikeout~~ || `~~strikeout~~` ||
|
|
40 |
|
|
41 |
You can mix these typefaces in some ways:
|
|
42 |
|
|
43 |
|| *Markup* || *Result* ||
|
|
44 |
|| `_*bold* in italics_` || _*bold* in italics_ ||
|
|
45 |
|| `*_italics_ in bold*` || *_italics_ in bold* ||
|
|
46 |
|| `*~~strike~~ works too*` || *~~strike~~ works too* ||
|
|
47 |
|| `~~as well as _this_ way round~~` || ~~as well as _this_ way round~~ ||
|
|
48 |
|
|
49 |
== Code ==
|
|
50 |
|
|
51 |
If you have a multiline code block that you want to display verbatim,
|
|
52 |
use the multiline code delimiter:
|
|
53 |
|
|
54 |
{{{
|
|
55 |
{{{
|
|
56 |
def fib(n):
|
|
57 |
if n == 0 or n == 1:
|
|
58 |
return n
|
|
59 |
else:
|
|
60 |
# This recursion is not good for large numbers.
|
|
61 |
return fib(n-1) + fib(n-2)
|
|
62 |
}}}
|
|
63 |
}}}
|
|
64 |
|
|
65 |
Which results in:
|
|
66 |
|
|
67 |
{{{
|
|
68 |
def fib(n):
|
|
69 |
if n == 0 or n == 1:
|
|
70 |
return n
|
|
71 |
else:
|
|
72 |
# This recursion is not good for large numbers.
|
|
73 |
return fib(n-1) + fib(n-2)
|
|
74 |
}}}
|
|
75 |
|
|
76 |
For more control over the syntax higlighting, the `<code>` tag allows you to specify a file extension:
|
|
77 |
|
|
78 |
{{{
|
|
79 |
<code language="xml">
|
|
80 |
<hello target="world"/>
|
|
81 |
</code>
|
|
82 |
}}}
|
|
83 |
|
|
84 |
To disable highlighting entirely, use the `<pre>` tag.
|
|
85 |
|
|
86 |
== Headings ==
|
|
87 |
|
|
88 |
{{{
|
|
89 |
= Heading =
|
|
90 |
== Subheading ==
|
|
91 |
=== Level 3 ===
|
|
92 |
==== Level 4 ====
|
|
93 |
===== Level 5 =====
|
|
94 |
====== Level 6 ======
|
|
95 |
}}}
|
|
96 |
|
|
97 |
== Dividers ==
|
|
98 |
|
|
99 |
Four or more dashes on a line by themselves results in a horizontal rule.
|
|
100 |
|
|
101 |
|
|
102 |
== Lists ==
|
|
103 |
|
1444
|
104 |
The HWKB wiki supports both bulleted and numbered lists. A list
|
590
|
105 |
must be indented at least one space to be recognized as such. You can
|
|
106 |
also nest lists one within the other by appropriate use of indenting:
|
|
107 |
|
|
108 |
{{{
|
|
109 |
The following is:
|
|
110 |
* A list
|
|
111 |
* Of bulleted items
|
|
112 |
# This is a numbered sublist
|
|
113 |
# Which is done by indenting further
|
|
114 |
* And back to the main bulleted list
|
|
115 |
|
|
116 |
* This is also a list
|
|
117 |
* With a single leading space
|
|
118 |
* Notice that it is rendered
|
|
119 |
# At the same levels
|
|
120 |
# As the above lists.
|
|
121 |
* Despite the different indentation levels.
|
|
122 |
}}}
|
|
123 |
|
|
124 |
The following is:
|
|
125 |
* A list
|
|
126 |
* Of bulleted items
|
|
127 |
# This is a numbered sublist
|
|
128 |
# Which is done by indenting further
|
|
129 |
* And back to the main bulleted list
|
|
130 |
|
|
131 |
* This is also a list
|
|
132 |
* With a single leading space
|
|
133 |
* Notice that it is rendered
|
|
134 |
# At the same levels
|
|
135 |
# As the above lists.
|
|
136 |
* Despite the different indentation levels.
|
|
137 |
|
|
138 |
== Quoting ==
|
|
139 |
|
|
140 |
Block quotes place emphasis on a particular extract of text in your
|
|
141 |
page. Block quotes are created by indenting a paragraph by at least
|
|
142 |
one space:
|
|
143 |
|
|
144 |
{{{
|
|
145 |
Someone once said:
|
|
146 |
|
|
147 |
This sentence will be quoted in the future as the canonical example
|
|
148 |
of a quote that is so important that it should be visually separate
|
|
149 |
from the rest of the text in which it appears.
|
|
150 |
}}}
|
|
151 |
|
|
152 |
Someone once said:
|
|
153 |
|
|
154 |
This sentence will be quoted in the future as the canonical example
|
|
155 |
of a quote that is so important that it should be visually separate
|
|
156 |
from the rest of the text in which it appears.
|
|
157 |
|
|
158 |
== Links ==
|
|
159 |
|
|
160 |
Links are central to the wiki principle, as they create the web of
|
1444
|
161 |
content. The HWKB wiki permits both internal (within the wiki) and
|
590
|
162 |
external links, and in some cases automatically creates a link when it
|
|
163 |
recognizes either a !WikiWord or an URL.
|
|
164 |
|
|
165 |
=== Internal wiki links ===
|
|
166 |
|
|
167 |
Internal links within a wiki are created using the syntax below. If
|
|
168 |
you add a wiki link to a page that does not exist, the link will
|
|
169 |
appear with a !LittleLink[WikiSyntax ?] to project committers and
|
|
170 |
owners. Clicking that link will take you to the page creation form
|
|
171 |
where you can enter content for that page.
|
|
172 |
|
|
173 |
If you are not logged in, wiki links that point to non-existent pages
|
|
174 |
will appear as plain text, without the link to the page creation
|
|
175 |
form. When you create the target page,
|
|
176 |
the link will become a normal hyperlink for all viewers of
|
|
177 |
the page.
|
|
178 |
|
|
179 |
{{{
|
|
180 |
WikiSyntax is identified and linked automatically
|
|
181 |
|
|
182 |
Wikipage is not identified, so if you have a page named [Wikipage] you
|
|
183 |
need to link it explicitly.
|
|
184 |
|
|
185 |
If the WikiSyntax page is actually about reindeers, you can provide a
|
|
186 |
description, so that people know you are actually linking to a page on
|
|
187 |
[WikiSyntax reindeer flotillas].
|
|
188 |
|
|
189 |
If you want to mention !WikiSyntax without it being autolinked, use an
|
|
190 |
exclamation mark to prevent linking.
|
|
191 |
}}}
|
|
192 |
|
|
193 |
WikiSyntax is identified and linked automatically
|
|
194 |
|
|
195 |
Wikipage is not identified, so if you have a page named [Wikipage] you
|
|
196 |
need to link it explicitly.
|
|
197 |
|
|
198 |
If the WikiSyntax page is actually about reindeers, you can provide a
|
|
199 |
description, so that people know you are actually linking to a page on
|
|
200 |
[WikiSyntax reindeer flotillas].
|
|
201 |
|
|
202 |
If you want to mention !WikiSyntax without it being autolinked, use an
|
|
203 |
exclamation mark to prevent linking.
|
|
204 |
|
|
205 |
=== Links to anchors within a page ===
|
|
206 |
|
|
207 |
Each heading defines a HTML anchor with the same name as the heading, but with spaces replaced by underscores. You can
|
|
208 |
create a link to a specific heading on a page like this:
|
|
209 |
|
|
210 |
{{{
|
|
211 |
[WikiSyntax#Wiki-style_markup]
|
|
212 |
}}}
|
|
213 |
|
|
214 |
And it will render as: [WikiSyntax#Wiki-style_markup].
|
|
215 |
|
|
216 |
=== Links to issues and revisions ===
|
|
217 |
|
|
218 |
You can easily link to issues and revisions using the following syntax.
|
|
219 |
|
|
220 |
* `issue 123` will be autolinked to issue number 123 in the current project. You can include a `#` or not. If the issue has been closed, the link will appear as a cross-out rather than an underline. Hovering your mouse over such a link shows the issue summary.
|
|
221 |
|
|
222 |
* `issue PROJECTNAME:122` will be autolinked to that issue number in the specified project. This is useful when your project depends on work being done in related projects.
|
|
223 |
|
|
224 |
* `r123` will be autolinked to the revision detail page for that revision in the current project.
|
|
225 |
|
|
226 |
There is currently no way to disable this type of autolinking. See issue 996.
|
|
227 |
|
|
228 |
{{{
|
|
229 |
For example: Please add a comment on issue 123 rather than adding more review comments to r456.
|
|
230 |
}}}
|
|
231 |
|
|
232 |
Renders as: Please add a comment on issue 123 rather than adding more review comments to r456.
|
|
233 |
|
|
234 |
|
|
235 |
=== Links to external pages ===
|
|
236 |
|
|
237 |
You can of course link to external pages from your own wiki pages,
|
|
238 |
using a syntax similar to that for internal links:
|
|
239 |
|
|
240 |
{{{
|
1444
|
241 |
Plain URLs such as https://www.example.org/ automatically made into links.
|
590
|
242 |
|
|
243 |
You can also provide some descriptive text. For example, the following
|
1444
|
244 |
link points to the [https://www.example.org Example homepage].
|
590
|
245 |
|
|
246 |
If your link points to an image, it will get inserted as an image tag
|
|
247 |
into the page:
|
|
248 |
|
1444
|
249 |
https://www.hedgewars.org/images/Static_Hat_Template.png
|
590
|
250 |
|
|
251 |
You can also make the image into a link, by setting the image URL as
|
|
252 |
the description of the URL you want to link:
|
|
253 |
|
1444
|
254 |
[https://www.hedgewars.org/ https://www.hedgewars.org/images/Static_Hat_Template.png]
|
590
|
255 |
}}}
|
|
256 |
|
1444
|
257 |
Plain URLs such as https://www.example.org/ automatically made into links.
|
590
|
258 |
|
|
259 |
You can also provide some descriptive text. For example, the following
|
1444
|
260 |
link points to the [https://www.example.org Example homepage].
|
|
261 |
|
|
262 |
If your link points to an image, it will get inserted as an image tag
|
|
263 |
into the page:
|
|
264 |
|
|
265 |
https://www.hedgewars.org/images/Static_Hat_Template.png
|
590
|
266 |
|
|
267 |
You can also make the image into a link, by setting the image URL as
|
|
268 |
the description of the URL you want to link:
|
|
269 |
|
|
270 |
{{{
|
1444
|
271 |
[https://www.hedgewars.org/ https://www.hedgewars.org/images/Static_Hat_Template.png]
|
590
|
272 |
}}}
|
|
273 |
|
1444
|
274 |
[https://www.hedgewars.org/ https://www.hedgewars.org/images/Static_Hat_Template.png]
|
590
|
275 |
|
|
276 |
=== Links to images ===
|
|
277 |
|
|
278 |
If your link points to an image (that is, if it ends in `.png`,
|
|
279 |
`.gif`, `.jpg` or `.jpeg`), it will get inserted as an image into the
|
|
280 |
page:
|
|
281 |
|
|
282 |
{{{
|
1444
|
283 |
https://www.hedgewars.org/images/Static_Hat_Template.png
|
590
|
284 |
}}}
|
|
285 |
|
1444
|
286 |
https://www.hedgewars.org/images/Static_Hat_Template.png
|
590
|
287 |
|
|
288 |
If the image is produced by a server-side script, you may need to add a nonsense query string parameter to the end so that the URL ends with a supported image filename extension.
|
|
289 |
|
|
290 |
{{{
|
|
291 |
http://chart.apis.google.com/chart?chs=200x125&chd=t:48.14,33.79,19.77|83.18,18.73,12.04&cht=bvg&nonsense=something_that_ends_with.png
|
|
292 |
}}}
|
|
293 |
|
|
294 |
http://chart.apis.google.com/chart?chs=200x125&chd=t:48.14,33.79,19.77|83.18,18.73,12.04&cht=bvg&nonsense=something_that_ends_with.png
|
|
295 |
|
|
296 |
== Tables ==
|
|
297 |
|
|
298 |
Tables are created by entering the content of each cell separated by
|
|
299 |
{{{||}}} delimiters. You can insert other inline wiki syntax in table
|
|
300 |
cells, including typeface formatting and links.
|
|
301 |
|
|
302 |
{{{
|
|
303 |
|| *Year* || *Temperature (low)* || *Temperature (high)* ||
|
|
304 |
|| 1900 || -10 || 25 ||
|
|
305 |
|| 1910 || -15 || 30 ||
|
|
306 |
|| 1920 || -10 || 32 ||
|
|
307 |
|| 1930 || _N/A_ || _N/A_ ||
|
|
308 |
|| 1940 || -2 || 40 ||
|
|
309 |
}}}
|
|
310 |
|
|
311 |
|| *Year* || *Temperature (low)* || *Temperature (high)* ||
|
|
312 |
|| 1900 || -10 || 25 ||
|
|
313 |
|| 1910 || -15 || 30 ||
|
|
314 |
|| 1920 || -10 || 32 ||
|
|
315 |
|| 1930 || _N/A_ || _N/A_ ||
|
|
316 |
|| 1940 || -2 || 40 ||
|
|
317 |
|
|
318 |
|
|
319 |
|
|
320 |
|
|
321 |
|
|
322 |
|
|
323 |
|
|
324 |
|
|
325 |
= HTML support =
|
|
326 |
To aid in the presentation of a wiki page there is some support for HTML. HTML tags are only supported in wiki pages, not in page comments.
|
|
327 |
|
|
328 |
HTML syntax can be used in conjunction with wiki syntax, but it is recommended against doing so where possible.<wiki:comment>Also, avoid blank lines between list items.</wiki:comment>
|
|
329 |
|
|
330 |
The following HTML tags and attributes are currently supported:
|
|
331 |
|
|
332 |
<table border=1>
|
|
333 |
<thead><th>HTML Tag</th><th>Supported Attributes</th></thead>
|
|
334 |
<tbody>
|
|
335 |
<tr><td>a</td><td>title dir lang href</td></tr>
|
|
336 |
<tr><td>b</td><td>title dir lang</td></tr>
|
|
337 |
<tr><td>br</td><td>title dir lang</td></tr>
|
|
338 |
<tr><td>blockquote</td><td>title dir lang</td></tr>
|
|
339 |
<tr><td>code</td><td>title dir lang language `[1]`</td></tr>
|
|
340 |
<tr><td>dd</td><td>title dir lang</td></tr>
|
|
341 |
<tr><td>div</td><td>title dir lang</td></tr>
|
|
342 |
<tr><td>dl</td><td>title dir lang</td></tr>
|
|
343 |
<tr><td>dt</td><td>title dir lang</td></tr>
|
|
344 |
<tr><td>em</td><td>title dir lang</td></tr>
|
|
345 |
<tr><td>font</td><td>title dir lang face size color</td></tr>
|
|
346 |
<tr><td>h1</td><td>title dir lang</td></tr>
|
|
347 |
<tr><td>h2</td><td>title dir lang</td></tr>
|
|
348 |
<tr><td>h3</td><td>title dir lang</td></tr>
|
|
349 |
<tr><td>h4</td><td>title dir lang</td></tr>
|
|
350 |
<tr><td>h5</td><td>title dir lang</td></tr>
|
|
351 |
<tr><td>i</td><td>title dir lang</td></tr>
|
|
352 |
<tr><td>img</td><td>title dir lang src alt border height width align</td></tr>
|
|
353 |
<tr><td>li</td><td>title dir lang</td></tr>
|
|
354 |
<tr><td>ol</td><td>title dir lang type start</td></tr>
|
|
355 |
<tr><td>p</td><td>title dir lang align</td></tr>
|
|
356 |
<tr><td>pre</td><td>title dir lang</td></tr>
|
|
357 |
<tr><td>q</td><td>title dir lang</td></tr>
|
|
358 |
<tr><td>s</td><td>title dir lang</td></tr>
|
|
359 |
<tr><td>span</td><td>title dir lang</td></tr> <tr><td>strike</td><td>title dir lang</td></tr> <tr><td>strong</td><td>title dir lang</td></tr>
|
|
360 |
<tr><td>sub</td><td>title dir lang</td></tr>
|
|
361 |
<tr><td>sup</td><td>title dir lang</td></tr>
|
|
362 |
<tr><td>table</td><td>title dir lang align valign cellspacing cellpadding border width height</td></tr>
|
|
363 |
<tr><td>tbody</td><td>title dir lang align valign cellspacing cellpadding border width height</td></tr>
|
|
364 |
<tr><td>td</td><td>title dir lang align valign cellspacing cellpadding border width height</td></tr>
|
|
365 |
<tr><td>tfoot</td><td>title dir lang align valign cellspacing cellpadding border width height</td></tr>
|
|
366 |
<tr><td>th</td><td>title dir lang align valign cellspacing cellpadding border width height</td></tr>
|
|
367 |
<tr><td>thead</td><td>title dir lang align valign cellspacing cellpadding border width height colspan rowspan</td></tr>
|
|
368 |
<tr><td>tr</td><td>title dir lang align valign cellspacing cellpadding border width height colspan rowspan</td></tr>
|
|
369 |
<tr><td>tt</td><td>title dir lang</td></tr>
|
|
370 |
<tr><td>u</td><td>title dir lang</td></tr>
|
|
371 |
<tr><td>ul</td><td>title dir lang type</td></tr>
|
|
372 |
<tr><td>var</td><td>title dir lang</td></tr> </tbody>
|
|
373 |
</table>
|
|
374 |
|
|
375 |
`[1]` The language attribute of the code tag is the file extension of the language used in the code block. It is used as a hint for the syntax highlighter.
|
|
376 |
|
|
377 |
== Escaping HTML Tags ==
|
|
378 |
|
|
379 |
When you want to display html tags directly on your wiki page (as opposed to rendered), you will need to escape each HTML tag.
|
|
380 |
|
|
381 |
HTML tags can be escaped as shown in the table below:
|
|
382 |
<table border="1">
|
|
383 |
<thead><th>Markup</th><th>Result</th></thead>
|
|
384 |
<tbody>
|
|
385 |
<tr><td> {{{`<hr>`}}}</td><td>`<hr>`</td></tr>
|
|
386 |
<tr><td> `{{{<hr>}}}`</td><td>{{{<hr>}}}</td></tr>
|
|
387 |
</tbody>
|
|
388 |
</table>
|
|
389 |
|
|
390 |
<br/>
|
|
391 |
|
|
392 |
= Comments =
|
|
393 |
|
|
394 |
The wiki supports embedded comments to help explain the contents of a wiki page. Anything inside the comment block is removed from the rendered page, but is visible when editing or viewing the source for that page.
|
|
395 |
|
|
396 |
{{{
|
|
397 |
<wiki:comment>
|
|
398 |
This text will be removed from the rendered page.
|
|
399 |
</wiki:comment>
|
|
400 |
}}}
|
|
401 |
|
|
402 |
|
|
403 |
= Navigation =
|
|
404 |
== Table of Contents ==
|
|
405 |
|
|
406 |
An inline table of contents can be generated from page headers on a wiki page. Add the following syntax to a page in the location the table of contents should be displayed:
|
|
407 |
|
|
408 |
{{{
|
|
409 |
<wiki:toc max_depth="1" />
|
|
410 |
}}}
|
|
411 |
|
|
412 |
Valid attributes are:
|
|
413 |
* `max_depth`: the maximum header depth to display in the table of contents
|
|
414 |
|
|
415 |
== Side navigation ==
|
|
416 |
|
1444
|
417 |
You can specify the sidebar for a wiki page by selecting another wiki page that defines your side navigation.
|
590
|
418 |
|
|
419 |
One way of adding a sidebar is by setting the #sidebar pragma, as shown below. Alternatively, the sidebar pragma can be left blank if no side navigation is desired.
|
|
420 |
|
|
421 |
|| #sidebar !TableOfContents ||
|
|
422 |
|
|
423 |
The side navigation that is defined should be in the format of a simple list, as shown below.
|
|
424 |
|
|
425 |
{{{
|
|
426 |
* [Articles HOWTO articles]
|
|
427 |
* [ArticlesXSS Web security]
|
|
428 |
* [ArticlesDom DOM manipulation]
|
|
429 |
* [ArticlesStyle CSS and style]
|
|
430 |
* [ArticlesTips Tips and tricks]
|
|
431 |
* [DOMReference DOM reference]
|
|
432 |
* [HTMLElements HTML reference]
|
|
433 |
* [CSSReference CSS reference]
|
|
434 |
}}}
|
|
435 |
|
1445
|
436 |
----
|
590
|
437 |
|
1444
|
438 |
_The content on this page is based on the old Google Code documentation for Google Code wikis and has been adapted and changed to fit the HWKB. The original document by Google is licensed under the [http://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0 License]. User-generated content is not included in this license._ |