#summary The reference to the wiki syntax for the Hedgewars Knowledge Base = Wiki Syntax = = Introduction = This page describes the wiki syntax of the Hedgewars Knowledge Base. Each wiki page is stored in a `.wiki` file in the [https://hg.hedgewars.org/hwkb/ hwkb repository]. There are just text files with some simple markup. Each file's name is the same as the wiki page name. And, each wiki file consists of optional pragma lines followed by the content of the page. = Pragmas = Optional pragma lines provide metadata about the page and how it should be displayed. These lines are only processed if they appear at the top of the file. Each pragma line begins with a pound-sign (#) and the pragma name, followed by a value. || *Pragma* || *Value* || || #summary || One-line summary of the page || || #labels || Comma-separated list of labels (filled in automatically via the web UI) || = Wiki-style markup = == Paragraphs == Use one or more blank lines to separate paragraphs. == Typeface == ||* Name/Sample* || * Markup * || || _italic_ || `_italic_` || || *bold* || `*bold*` || || `code` || {{{`code`}}} || || {{{code}}} || `{{{code}}}` || || ^super^script || `^super^script` || || ,,sub,,script || `,,sub,,script` || || ~~strikeout~~ || `~~strikeout~~` || You can mix these typefaces in some ways: || *Markup* || *Result* || || `_*bold* in italics_` || _*bold* in italics_ || || `*_italics_ in bold*` || *_italics_ in bold* || || `*~~strike~~ works too*` || *~~strike~~ works too* || || `~~as well as _this_ way round~~` || ~~as well as _this_ way round~~ || == Code == If you have a multiline code block that you want to display verbatim, use the multiline code delimiter: {{{ {{{ def fib(n): if n == 0 or n == 1: return n else: # This recursion is not good for large numbers. return fib(n-1) + fib(n-2) }}} }}} Which results in: {{{ def fib(n): if n == 0 or n == 1: return n else: # This recursion is not good for large numbers. return fib(n-1) + fib(n-2) }}} For more control over the syntax higlighting, the `` tag allows you to specify a file extension: {{{ }}} To disable highlighting entirely, use the `
` tag.

== Headings ==

{{{
= Heading =
== Subheading ==
=== Level 3 ===
==== Level 4 ====
===== Level 5 =====
====== Level 6 ======
}}}

== Dividers ==

Four or more dashes on a line by themselves results in a horizontal rule.


== Lists ==

The HWKB wiki supports both bulleted and numbered lists. A list
must be indented at least one space to be recognized as such. You can
also nest lists one within the other by appropriate use of indenting:

{{{
The following is:
  * A list
  * Of bulleted items
    # This is a numbered sublist
    # Which is done by indenting further
  * And back to the main bulleted list

 * This is also a list
 * With a single leading space
 * Notice that it is rendered
  # At the same levels
  # As the above lists.
 * Despite the different indentation levels.
}}}

The following is:
  * A list
  * Of bulleted items
    # This is a numbered sublist
    # Which is done by indenting further
  * And back to the main bulleted list

 * This is also a list
 * With a single leading space
 * Notice that it is rendered
  # At the same levels
  # As the above lists.
 * Despite the different indentation levels.

== Quoting ==

Block quotes place emphasis on a particular extract of text in your
page. Block quotes are created by indenting a paragraph by at least
one space:

{{{
Someone once said:

  This sentence will be quoted in the future as the canonical example
  of a quote that is so important that it should be visually separate
  from the rest of the text in which it appears.
}}}

Someone once said:

  This sentence will be quoted in the future as the canonical example
  of a quote that is so important that it should be visually separate
  from the rest of the text in which it appears.

== Links ==

Links are central to the wiki principle, as they create the web of
content. The HWKB wiki permits both internal (within the wiki) and
external links, and in some cases automatically creates a link when it
recognizes either a !WikiWord or an URL.

=== Internal wiki links ===

Internal links within a wiki are created using the syntax below. If
you add a wiki link to a page that does not exist, the link will
appear with a !LittleLink[WikiSyntax ?] to project committers and
owners. Clicking that link will take you to the page creation form
where you can enter content for that page.

If you are not logged in, wiki links that point to non-existent pages
will appear as plain text, without the link to the page creation
form. When you create the target page,
the link will become a normal hyperlink for all viewers of
the page.

{{{
WikiSyntax is identified and linked automatically

Wikipage is not identified, so if you have a page named [Wikipage] you
need to link it explicitly.

If the WikiSyntax page is actually about reindeers, you can provide a
description, so that people know you are actually linking to a page on
[WikiSyntax reindeer flotillas].

If you want to mention !WikiSyntax without it being autolinked, use an
exclamation mark to prevent linking.
}}}

WikiSyntax is identified and linked automatically

Wikipage is not identified, so if you have a page named [Wikipage] you
need to link it explicitly.

If the WikiSyntax page is actually about reindeers, you can provide a
description, so that people know you are actually linking to a page on
[WikiSyntax reindeer flotillas].

If you want to mention !WikiSyntax without it being autolinked, use an
exclamation mark to prevent linking.

=== Links to anchors within a page ===

Each heading defines a HTML anchor with the same name as the heading, but with spaces replaced by underscores. You can
create a link to a specific heading on a page like this:

{{{
[WikiSyntax#Wiki-style_markup]
}}}

And it will render as: [WikiSyntax#Wiki-style_markup].

=== Links to issues and revisions ===

You can easily link to issues and revisions using the following syntax.

  * `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.

  * `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.

  * `r123` will be autolinked to the revision detail page for that revision in the current project.

There is currently no way to disable this type of autolinking. See issue 996.

{{{
For example: Please add a comment on issue 123 rather than adding more review comments to r456. 
}}}

Renders as: Please add a comment on issue 123 rather than adding more review comments to r456.


=== Links to external pages ===

You can of course link to external pages from your own wiki pages,
using a syntax similar to that for internal links:

{{{
Plain URLs such as https://www.example.org/ automatically made into links.

You can also provide some descriptive text. For example, the following
link points to the [https://www.example.org Example homepage].

If your link points to an image, it will get inserted as an image tag
into the page:

https://www.hedgewars.org/images/Static_Hat_Template.png

You can also make the image into a link, by setting the image URL as
the description of the URL you want to link:

[https://www.hedgewars.org/ https://www.hedgewars.org/images/Static_Hat_Template.png]
}}}

Plain URLs such as https://www.example.org/ automatically made into links.

You can also provide some descriptive text. For example, the following
link points to the [https://www.example.org Example homepage].

If your link points to an image, it will get inserted as an image tag
into the page:

https://www.hedgewars.org/images/hwkb_example.png

You can also make the image into a link, by setting the image URL as
the description of the URL you want to link:

{{{
[https://www.hedgewars.org/ https://www.hedgewars.org/images/hwkb_example.png]
}}}

[https://www.hedgewars.org/ https://www.hedgewars.org/images/hwkb_example.png]

=== Links to images ===

If your link points to an image (that is, if it ends in `.png`,
`.gif`, `.jpg` or `.jpeg`), it will get inserted as an image into the
page:

{{{
https://www.hedgewars.org/images/hwkb_example.png
}}}

https://www.hedgewars.org/images/hwkb_example.png

If the URL of the image does not end with a standard file name suffix such as `.png`, you may need to add a `nonsense` query string parameter to the end so that the URL ends with a supported image filename extension. For example, for the URL `https://www.hedgewars.org/images/hwkb_example.foo` (which refers to a PNG image), this would become:

{{{
https://www.hedgewars.org/images/hwkb_example.foo&nonsense=something_that_ends_with.png
}}}

https://www.hedgewars.org/images/hwkb_example.foo&nonsense=something_that_ends_with.png

== Tables ==

Tables are created by entering the content of each cell separated by
{{{||}}} delimiters. You can insert other inline wiki syntax in table
cells, including typeface formatting and links.

{{{
|| *Year* || *Temperature (low)* || *Temperature (high)* ||
|| 1900 || -10 || 25 ||
|| 1910 || -15 || 30 ||
|| 1920 || -10 || 32 ||
|| 1930 || _N/A_ || _N/A_ ||
|| 1940 || -2 || 40 ||
}}}

|| *Year* || *Temperature (low)* || *Temperature (high)* ||
|| 1900 || -10 || 25 ||
|| 1910 || -15 || 30 ||
|| 1920 || -10 || 32 ||
|| 1930 || _N/A_ || _N/A_ ||
|| 1940 || -2 || 40 ||








= HTML support =
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.

HTML syntax can be used in conjunction with wiki syntax, but it is recommended against doing so where possible.Also, avoid blank lines between list items.

The following HTML tags and attributes are currently supported:

HTML TagSupported Attributes
atitle dir lang href
btitle dir lang
brtitle dir lang
blockquotetitle dir lang
codetitle dir lang language `[1]`
ddtitle dir lang
divtitle dir lang
dltitle dir lang
dttitle dir lang
emtitle dir lang
fonttitle dir lang face size color
h1title dir lang
h2title dir lang
h3title dir lang
h4title dir lang
h5title dir lang
ititle dir lang
imgtitle dir lang src alt border height width align
lititle dir lang
oltitle dir lang type start
ptitle dir lang align
pretitle dir lang
qtitle dir lang
stitle dir lang
spantitle dir lang
striketitle dir lang
strongtitle dir lang
subtitle dir lang
suptitle dir lang
tabletitle dir lang align valign cellspacing cellpadding border width height
tbodytitle dir lang align valign cellspacing cellpadding border width height
tdtitle dir lang align valign cellspacing cellpadding border width height
tfoottitle dir lang align valign cellspacing cellpadding border width height
thtitle dir lang align valign cellspacing cellpadding border width height
theadtitle dir lang align valign cellspacing cellpadding border width height colspan rowspan
trtitle dir lang align valign cellspacing cellpadding border width height colspan rowspan
tttitle dir lang
utitle dir lang
ultitle dir lang type
vartitle dir lang
`[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. == Escaping HTML Tags == When you want to display html tags directly on your wiki page (as opposed to rendered), you will need to escape each HTML tag. HTML tags can be escaped as shown in the table below:
MarkupResult
{{{`
`}}}
`
`
`{{{
}}}`
{{{
}}}
= Comments = 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. {{{ This text will be removed from the rendered page. }}} = Navigation = == Table of Contents == 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: {{{ }}} Valid attributes are: * `max_depth`: the maximum header depth to display in the table of contents == Side navigation == The sidebar is just another wiki page and defined in the special page [TableOfContents]. The side navigation that is defined should be in the format of a simple list, as shown below: {{{ * [Articles HOWTO articles] * [ArticlesXSS Web security] * [ArticlesDom DOM manipulation] * [ArticlesStyle CSS and style] * [ArticlesTips Tips and tricks] * [DOMReference DOM reference] * [HTMLElements HTML reference] * [CSSReference CSS reference] }}} ---- _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 Hedgewars Knowledge Base. 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._