Help:Wikitext Guide: Difference between revisions

m (→‎Table of Contents: fixing formatting)
No edit summary
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Wikitext language (also known as Wiki markup) can be used to change the format and layout of text in Wiki articles.
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 [http://en.wikipedia.org/wiki/Help:HTML_in_wikitext HTML in wikitext] article.


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


==Basic Character and Paragraph Formatting==
=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.
Basic formatting helps readers easily see warnings, code, and other important information.  You can apply more than one format to text.


{| style="width:100%" border="1" cellpadding="2" cellspacing="0"
{| style="width:100%" border="1" cellpadding="5" cellspacing="0"
! style="width:15%"| Name  
! style="width:15%" bgcolor="tan"| Name  
! Wikitext  
! bgcolor="tan"| Wikitext  
! style="width:50% | Example
! style="width:50% bgcolor="tan"| Example
|-
|-
| Italic  
| Italic  
Line 32: Line 32:
|}
|}


==Headings==
=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.
Markup for headings should be used within your article in order to break-up and organize sections of information.
 
{| style="width:100%" border="1" cellpadding="5" cellspacing="0"
{| style="width:100%" border="1" cellpadding="10" cellspacing="0"
! style="width:15%" bgcolor="tan"| Name  
! style="width:15%"| Name  
! bgcolor="tan"| Wikitext  
! Wikitext  
! style="width:50% bgcolor="tan"| Example
! style="width:50% | Example
|-
|-
| Heading 1
| Heading 1
Line 57: Line 56:
|}
|}


===Table of Contents===
'''''Note''': Wikitext will not process any heading level past Heading 6If you are trying to present information in sections within a level 6 heading, consider using a table to organize and present your information.''
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.


To force a TOC to appear in an article with less than four headings:
==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:


  <nowiki>__FORCETOC__</nowiki>
  <nowiki>__FORCETOC__</nowiki>


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


  <nowiki> __TOC__</nowiki>
  <nowiki> __TOC__</nowiki>


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


  <nowiki>__NOTOC__</nowiki>
  <nowiki>__NOTOC__</nowiki>


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


Line 81: Line 85:
  <nowiki>[[Wikitext#Sections and Headings]]</nowiki>
  <nowiki>[[Wikitext#Sections and Headings]]</nowiki>


==Lists==
=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. <nowiki>#*Bulleted list within a numbered list</nowiki>, <nowiki>::*Double indented bullet, etc.</nowiki>)
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. <nowiki>#*Bulleted list within a numbered list</nowiki>, <nowiki>::*Double indented bullet, etc.</nowiki>)


{| style="width:100%" border="1" cellpadding="2" cellspacing="0"
{| style="width:100%" border="1" cellpadding="5" cellspacing="0"
! style="width:15%"| Name  
! style="width:15%" bgcolor="tan"| Name  
! Wikitext  
! bgcolor="tan"| Wikitext  
! style="width:50% | Example
! style="width:50% bgcolor="tan"| Example
|-
|-
|Numbered list  
|Numbered list  
Line 130: Line 134:
|}
|}


=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><nowiki></nowiki> Tag==
The '''<nowiki><nowiki></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><nowiki></nowiki>''' tag.
{| style="width:100%" border="1" cellpadding="5" cellspacing="0"
! bgcolor="tan"| Text without '''<nowiki><nowiki></nowiki>''' tag
! bgcolor="tan"| Text with '''<nowiki><nowiki></nowiki>''' tag
! bgcolor="tan"| Mark-up
|-
|
* is used as a wild card in the ZWC search.
|
<nowiki>*</nowiki> is used as a wild card in the ZWC search.
|<nowiki><nowiki></nowiki>*</nowiki> is used as a wild card in the ZWC search.
|-
|http://example.website.com
|<nowiki>http://example.website.com</nowiki>
|<nowiki><nowiki>http://example.website.com</nowiki></nowiki>
|-
|The <pre> tag creates a section for a block of pre-formatted text.</pre>
|The <nowiki><pre></nowiki> tag creates a section for a block of pre-formatted text.
|The <nowiki><nowiki><pre></nowiki></nowiki> tag creates a section for a block of pre-formatted text.
|}
'''''Note''': You can also use the <nowiki><nowiki></nowiki> tag to disable leading spaces. This is useful if you do not want a pre-formatted text box around lines with leading spaces.''
==<nowiki><pre></nowiki> 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 <nowiki><pre></nowiki> 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 <nowiki><pre></nowiki>, insert '''<nowiki><pre></nowiki>''' at the beginning of the text block, and insert '''<nowiki></pre></nowiki>''' 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 <nowiki><pre></nowiki> 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><nowiki></nowiki> tag.''
==Special Characters==
Trying to present the code for special characters in a Wiki can be particularly frustrating since the <nowiki><nowiki> tag, <pre></nowiki> tag, and leading spaces do not prevent Wikitext formatting from interpreting these characters.  For example, trying to type '''&amp;amp;''' or '''&amp;rarr;''' results in '''&amp;''' or '''&rarr;''' 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:
&amp;amp;rarr; 
To represent the code for an ampersand, type:
&amp;amp;amp;
==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 '''<nowiki>[[Help:Wikitext Guide]]</nowiki>'''.)  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 '''<nowiki>[[Category:Help]]</nowiki>''' 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:
<nowiki>[[:Category:Help]]</nowiki>
=More Help=
Consult the MediaWiki [http://meta.wikimedia.org/wiki/Help:Contents#For_editors: User's Guide Section for Editors] for more information on using the wiki software.


[[Category:Help]]
[[Category:Help]]

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.

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.

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

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:

__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 Mark-up
  • 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.

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.

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, to represent the code for an arrow, type:

&amp;rarr;  

To represent the code for an ampersand, type:

&amp;amp;

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:

[[:Category:Help]]

More Help

Consult the MediaWiki User's Guide Section for Editors for more information on using the wiki software.

Jump to: navigation, search