Help:Wikitext Guide

Revision as of 23:55, 10 October 2008 by Cfremon (talk | contribs) (→‎Disabling Wikitext Interpretation or Formatting: Adding information about linking to Category pages)

Wikitext language (also known as Wiki markup) can be used to change the format and layout of text in Wiki articles. In some cases, there is no Wikitext alternative for HTML. (E.g. You must use HTML to underline or strikeout text.) In these cases, Wikitext language allows for the use of HMTL. For a list of HTML that is allowable in Wiki documents, refer to Wikipedia's HTML in wikitext article.

This article contains examples and explanations of commonly used Wikitext language.

Basic Character and Paragraph Formatting

Basic formatting helps readers easily see warnings, code, and other important information. You can apply more than one format to text.

Name Wikitext Example
Italic ''Italic'' Italic
Bold '''Bold''' Bold
Code Use a single space before a line of code
Code
New paragraph Use a single blank line before the start of a new paragraph

Use a single blank line

before the start of a new paragraph

Headings

Markup for headings should be used within your article in order to break-up and organize sections of information. Because the title of the page is already displayed in Heading 1 markup at the top of the page, any headings you include should begin with Heading 2 markup.

Name Wikitext Example
Heading 1 =Heading 1=
Heading 1
Heading 2 ==Heading 2==
Heading 2
Heading 3 ===Heading 3===
Heading 3
Heading 4 ====Heading 4====
Heading 4

Table of Contents

Using four headings or more within an article will automatically generate a Table of Contents (TOC). This TOC will appear above the first heading in the document.

Force a TOC

To force a TOC to appear in an article with less than four headings, use the following markup anywhere in the article:

__FORCETOC__

Insert a TOC

To place this TOC at a specific point in the document, use this markup at the insertion point:

 __TOC__

Remove a TOC

To eliminate a TOC from your article, use the following markup anywhere in the article:

__NOTOC__

Linking to Headings

You can also link directly to a section that has a heading using the following markup:

[[Article Name#Heading Name]]

For example, to link to the Sections and Headings section of the Wikitext article:

[[Wikitext#Sections and Headings]]

Lists

Lists can use numbers, bullets, or indents. If a numbered list is interrupted, the next numbered item will start at 1. You can mix and match Wikitext to create bulleted lists within numbered lists, or in order to indent a bulleted or numbered list. (E.g. #*Bulleted list within a numbered list, ::*Double indented bullet, etc.)

Name Wikitext Example
Numbered list #List item
  1. List item
Numbered list, second level ##Second level list item
  1. Second level list item
Numbered list, third level ###Third level list item
  1. Third level list item
Bullet *Bullet item
  • Bullet item
Bullet, second level **Second level bullet item
  • Second level bullet item
Bullet, third level ***Third level bullet item
  • Third level bullet item
Indent :Indented text
Indented text
Indent, second level ::Second level indent
Second level indent


Disabling Wikitext Interpretation or Formatting

Wikitext will reinterpret or reformat certain characters or text including asterisks, colons, pound signs, and single quotes. This can cause an issue when presenting text that needs have these characters presented in their original formatting. There are several ways to preserve the original formatting of text. Code, ASCII, XML-escaped characters, and other pre-formatted text can be preserved by using the following tools to disable Wikitext interpretation.

<nowiki> Tag

The <nowiki> tag is very useful for preserving the formatting of single words or a group of words within a paragraph. The tag is useful if you want to avoid turning an example link into a live link, display an HTML tag, or if you want to use a colon, pound sign, asterisk, or single quotes without triggering Wikitext formatting. It can also prevent a pipe character ( | ) or a dash ( - ) from creating a new row or column in a Wiki table. The following examples show text with and without a <nowiki> tag.

Text without <nowiki> tag Text with <nowiki> tag Usage
  • is used as a wild card in the ZWC search.

* is used as a wild card in the ZWC search.

<nowiki>*</nowiki> is used as a wild card in the ZWC search.
http://example.website.com http://example.website.com <nowiki>http://example.website.com</nowiki>
The
 tag creates a section for a block of pre-formatted text.
The <pre> tag creates a section for a block of pre-formatted text. The <nowiki><pre></nowiki> tag creates a section for a block of pre-formatted text.

<pre> Tag and Leading Spaces

If you want to present a large amount of text without formatting, such as a script or code, try using a <pre> tag. This will preserve and place it in a light blue box with a dotted line around the edges. This is useful for indicating a large amount of code or text that is part of a single section, as well as for preserving your text. To use a <pre>, insert <pre> at the beginning of the text block, and insert </pre> at the end of the text block.

You can also create the same pre-formatted text box by using a single space before each line of text. This is called using leading spaces. Leading spaces will only include text in the same paragraph as other text with leading spaces. Any additional paragraphs separated by a single blank line will appear in separate pre-formatted text boxes. By adding a leading space to the single blank line the pre-formatted text box.

Special Characters

Trying to present the code for special characters in a Wiki can be particularly frustrating since the <nowiki> tag, <pre> tag, and leading spaces do not prevent Wikitext formatting from interpreting these characters. For example, trying to type &amp; or &rarr; results in & or rather than the text that you originally typed.

The only way to accurately represent special character code in a Wiki is to type out the character code for the ampersand preceding the rest of the character code. For example, in order to represent the code for an arrow, type &amp;rarr;. To represent the code for an ampersand, type &amp;amp;.

Creaing a Link to a Category

Normally, to create an internal link you place double brackets around the name of the article you are linking to. (E.g. I can link to this article by typing [[Help:Wikitext Guide]].) However, using this technique with a Category page does not create a link to the category; instead it tags the article as belonging to that category. (E.g. Typing [[Category:Help]] adds the Help category tag to the bottom of this article, and adds the article to the Help category page, but does not create a link in the body of the article to the Help Category page.)

To create a link to a category, you must place a colon before the name of the category. For example, to link to the Help category, type [[:Category:Help]].

Jump to: navigation, search