Difference between revisions of "Help:Wikitext Guide"
m (added mediawiki help link)
|Line 190:||Line 190:|
Consult the MediaWiki [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] for more information on using the wiki software.
Consult the MediaWiki [http://meta.wikimedia.org/wiki/Help:ContentsUser's Guide ] for more information on using the wiki software.
Latest revision as of 17:08, 17 March 2009
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.
- 1 Basic Character and Paragraph Formatting
- 2 Headings
- 3 Lists
- 4 Disabling Wikitext Interpretation or Formatting
- 5 More Help
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.
|Code||Use a single space before a line of 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
Markup for headings should be used within your article in order to break-up and organize sections of information.
|Heading 1||=Heading 1=|
|Heading 2||==Heading 2==|
|Heading 3||===Heading 3===|| |
|Heading 4||====Heading 4====|| |
Note: Wikitext will not process any heading level past Heading 6. If you are trying to present information in sections within a level 6 heading, consider using a table to organize and present your information.
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:
Insert a TOC
To place this TOC at a specific point in the document, use this markup at the insertion point:
Remove a TOC
To eliminate a TOC from your article, use the following markup anywhere in the article:
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 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.)
|Numbered list||#List item||
|Numbered list, second level||##Second level list item||
|Numbered list, third level||###Third level list item||
|Bullet, second level||**Second level bullet item||
|Bullet, third level||***Third level bullet item||
|Indent, second level||::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.
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||Mark-up|
* is used as a wild card in the ZWC search.
|<nowiki>*</nowiki> is used as a wild card in the ZWC search.|
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.|
Note: You can also use the <nowiki> tag to disable leading spaces. This is useful if you do not want a pre-formatted text box around lines with leading spaces.
<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.
Note: There is Wikitext mark-up and character coding that will be interpreted inside of a <pre> tag or inside of leading spaces. Be sure to review your text for any issues. You can fix most issue areas by using the <nowiki> tag.
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 & or → 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, to represent the code for an arrow, type:
To represent the code for an ampersand, type:
Creating 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 page, place a colon before the name of the Category page you are linking to.
For example, to link to the Help category, type:
Consult the MediaWiki User's Guide Section for Editors for more information on using the wiki software.