Help:Wikicode: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (it is there for a reason...)
mNo edit summary
(23 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{incomplete}}
This article will explain the basics of wikicode, giving examples of the various techniques used to make the many pages on Bulbapedia. While this may be helpful, however, the best way to learn is to look at the coding on a page to see how it is done, and modify it to see how it changes—just make sure to make any modifications in a sandbox and use the preview button!


This article explains the basics of wikicode and gives examples of various techniques. Of course, the best way to learn how to do something is usually to find an example of a page which has it and copy the code, modifying as necessary. But remember to preview!
==Frequently used text formatting==
{| class="roundy" align="center" style="border: 2px solid #{{bulba color}}; background: #{{bulba color}};"  width="100%"
! style="{{roundytl|5px}} background: #{{bulba color light}}" width="50%" | Edit box code
! style="{{roundytr|5px}} background: #{{bulba color light}}" width="50%" | Page appearance
|- align="left" style="background:#FFFFFF;"
| <pre>Apostrophes can alter the appearance of text:
*''This is italic text''
*'''This is bold text'''
*'''''This is bold italic text'''''
But watch out that you put the right amount!
*''''This is bold text with badly-formatted apostrophes of fail''''</pre>
| Apostrophes can alter the appearance of text:
*''This is italic text''
*'''This is bold text'''
*'''''This is bold italic text'''''
But watch out that you put the right amount!
*''''This is bold text with badly-formatted apostrophes of fail''''
|- align="left" style="background:#FFFFFF;"
| <pre>You can also indent things!
:Make this line indent once...
::or twice...
::::::::::::or twelve times!
Just don't do this to indent or you fail at wiki.</pre>
| You can also indent things!
:Make this line indent once...
::or twice...
::::::::::::or twelve times!
Just don't do this to indent or you fail at wiki.
|}


==Text Formatting==
==Links==
===Bolding===
===Basic link===
To make text bold, place <nowiki>'''</nowiki> on both sides of the text to be bolded.
To link to an article with the same name as the text, put <nowiki>[[</nowiki> before the text to be linked and <nowiki>]]</nowiki> after the text.


Example:
Example:


<code><nowiki>'''Noctowl'''</nowiki></code>
<code><nowiki>[[Vermilion City]]</nowiki></code>


Will make:
Will make:


'''Noctowl'''
[[Vermilion City]]


An alternative is using <code><nowiki><b></nowiki>INSERT TEXT HERE<nowiki></b></nowiki></code>.
===Piped link===
 
To link to an article with a different name as the text, put <nowiki>[[</nowiki> before the text to be linked and <nowiki>]]</nowiki> after it, but, right after the <nowiki>[[</nowiki>, put the title of the article followed by a <nowiki>|</nowiki>.
===Italicizing===
To italicize text, place <nowiki>''</nowiki> on both sides of the text to be italicized.


Example:
Example:


<code><nowiki>''Bronzong''</nowiki></code>
<code><nowiki>[[Ash's Pikachu|his Pikachu]]</nowiki></code>


Will make:
Will make:


''Bronzong''
[[Ash's Pikachu|his Pikachu]]


===Blue box===
===Shortlinks===
To put a blue box around a line of text, put a space before the line to have the box.
{{main|Bulbapedia:List of link templates}}
These '''must''' be used in articles when necessary.
 
Example: <code><nowiki>{{p|Pikachu}}</nowiki></code>
 
Will result in:


Example:
{{p|Pikachu}}


<code>&nbsp;Manaphy</code>
Instead of:


Will make:
[[Pikachu]]


Manaphy
===Interwiki links===
Interwiki links can be used to link to other wikis affiliated with Bulbapedia, such as [[Bulbagarden Archives]], [[Bulbanews]], Wikipedia, other members of [[Encyclopædiæ Pokémonis]], and other members of [[Nintendo Independent Wiki Alliance|NIWA]]. To link to another wiki, simply use square brackets like a normal link, but place the prefix at the start of the link.


===Indenting===
When linking to an Encyclopædiæ Pokémonis member via this method, there must be a colon : before the prefix, or it will not link correctly.
To indent a line of text, put a colon before the line to be indented.


Example:
Example:


<code><nowiki>:Goldenrod City</nowiki></code>
<code><nowiki>[[wp:Pokémon|Pokémon]]</nowiki></code>


Will make:
Will make:


:Goldenrod City
[[wp:Pokémon|Pokémon]]


More colons can be added to make the spacing large, but it is recommended to only use this in talk pages and to restart the line of colons after 6.
'''Note''': most interwiki prefixes have identically named templates, so to link to Wikipedia's article on Pokémon, it can be achieved by typing <code><nowiki>[[wp:Pokémon|Pokémon]]</nowiki></code> or <code><nowiki>{{wp|Pokémon}}</nowiki></code>.
 
====Incomplete list of interwiki prefixes====
{| {| class="roundy" align="center" style="background: #{{bulba color}}; border: 5px solid #{{bulba color dark}};"
|-
|
{| border=1 width="100%" align="center" style="background: #FFFFFF; border:1px solid #{{bulba color}}; border-collapse:collapse;"
|- style="background: #{{bulba color}};"
! Wiki
! Prefix
|-
|[[Bulbagarden Archives]]
|a
|-
|[[Bulbapedia]]{{tt|*|for Bulbanews/Bulbagarden Archives}}
|bp
|-
|[[PokéWiki]]
|:de
|-
|[[Donkey Kong Wiki]]
|dk
|-
|[[Pokéteca]]
|:es
|-
|[[Fire Emblem Wiki]]
|few
|-
|[[Poképédia]]
|:fr
|-
|[[Golden Sun Universe]]
|gsu
|-
|[[Pokémon Central Wiki]]
|:it
|-
|[[Pokémon Wiki]]
|:ja
|-
|[[Starfy Wiki]]
|lsw
|-
|[[Lylat Wiki]]
|lw
|-
|[[Nookipedia]]
|np
|-
|[[NintendoWiki]]
|nw
|-
|[[Metroid Wiki]]
|met
|-
|MediaWiki
|mw
|-
|[[Bulbanews]]
|n
|-
|[[Pikipedia]]
|pk
|-
|[[Wikinezka]]
|:pl
|-
|[[LANDpedia]]
|:pt
|-
|[[SmashWiki]]
|sbw
|-
|[[Super Mario Wiki]]
|smw
|-
|[[StrategyWiki]]
|strategy
|-
|[[WikiBound]]
|wb
|-
|Wiktionary
|wiktionary
|-
|[[WiKirby]]
|wk
|-
|Wikipedia
|wp
|-
|[[Wars Wiki]]
|ww
|-
|[[Zelda Wiki]]
|zw
|}
|}


==Links==
===Incomplete link===
===Basic link===
====Prefix removal====
To link to an article with the same name as the text, put <nowiki>[[</nowiki> before the text to be linked and <nowiki>]]</nowiki> after the text.
When using interwiki links or linking to pages not in the main namespace, typing <code><nowiki>[[prefix:Link name|]]</nowiki></code> causes it to be substituted by <code><nowiki>[[prefix:Link name|Link name]]</nowiki></code> after saving the page.


Example:
Example:


<code><nowiki>[[Vermilion City]]</nowiki></code>
<code><nowiki>[[Template:Welcome|]]</nowiki></code>
 
Will be substituted to:
 
<code><nowiki>[[Template:Welcome|Welcome]]</nowiki></code>


Will make:
Will make:


[[Vermilion City]]
[[Template:Welcome|Welcome]]
 
This also works for [[#Interwiki links|interwiki prefixes]]. Note that in most cases {{bp|link templates}} exist to compensate for this purpose and are preferred.


===Piped link===
====Parenthesis removal====
To link to an article with a different name as the text, put <nowiki>[[</nowiki> before the text to be linked and <nowiki>]]</nowiki> after it, but, right after the <nowiki>[[</nowiki>, put the title of the article followed by a <nowiki>|</nowiki>.
Linking to a page with parentheses in its title with blank display text results in the display text becoming


Example:
Example:


<code><nowiki>[[Ash's Pikachu|his Pikachu]]</nowiki></code>
<code><nowiki>[[Meowth (Team Rocket)|]]</nowiki></code>
 
Will be substituted to:
 
<code><nowiki>[[Meowth (Team Rocket)|Meowth]]</nowiki></code>


Will make:
Will make:


[[Ash's Pikachu|his Pikachu]]
[[Meowth (Team Rocket)|Meowth]]
===Shortlinks===
 
{{main|Bulbapedia:List of link templates}}
Note that in most cases {{bp|link templates}} exist to compensate for this purpose and are preferred. When a specific link template does not exist, using {{template|OBP}} is preferred.
These '''must''' be used in articles when necessary.
 
====Issues with commas====
Linking to a page with one or more commas in the title results in all the text after the comma being cut off.  
 
Example:
 
<code><nowiki>[[Get Fired Up, Spiky-eared Pichu!|]]</nowiki></code>


Example: <code><nowiki>{{AP|Pikachu}}</nowiki></code>
Will be substituted to:


Will result in:
<code><nowiki>[[Get Fired Up, Spiky-eared Pichu!|Get Fired Up]]</nowiki></code>


{{AP|Pikachu}}
Will make:


Instead of:
[[Get Fired Up, Spiky-eared Pichu!|Get Fired Up]]


[[Pikachu]]
Due to this issue, it is recommended to not use this technique when dealing with titles that have commas.


===External link===
===External link===
To link to a page outside Bulbapedia and give it a name, write the URL, a space, the name, then finally put brackets around everything, like so: put <nowiki>[</nowiki> before the url and name and <nowiki>]</nowiki> after it
To link to a page outside Bulbapedia and give it a name, write the URL, a space, the name, then finally put brackets around everything, like so: put <nowiki>[</nowiki> before the url and name and <nowiki>]</nowiki> after it.


Example:
Example:


<code><nowiki>[http://wikipedia.org nifty pages]</nowiki></code>
<code><nowiki>[http://www.pokemon.com/us/ Official Pokémon website]</nowiki></code>


Will make:
Will make:


[http://wikipedia.org nifty pages]
[http://www.pokemon.com/us/ Official Pokémon website]


 
To link to an external page without giving it a specific name, simply write the URL without any brackets or spaces, like so: http://www.pokemon.com/us/
To link to an external page without giving it specific name, simply write the url without any brackets or spaces, like so: http://www.pokemon.com/Dungeon/PersonalityTest


However, an external picture not in the archives may also be placed with exactly the same technique:
However, an external picture not in the archives may also be placed with exactly the same technique:


Example: <code><nowiki>http://archives.bulbagarden.net/w/upload/0/0a/025.png</nowiki></code>
Example: <code><nowiki>http://www.bulbagarden.net/gateway/banner-pikachu.png</nowiki></code>


Result:http://archives.bulbagarden.net/w/upload/0/0a/025.png
Result: http://www.bulbagarden.net/gateway/banner-pikachu.png


Note that it is not recommended to do this in mainspace articles.
Note that this is not to be done in mainspace articles.


==Table==
==Table==
Line 166: Line 310:


==Headings==
==Headings==
In order to make a heading, type two = before and after your heading on a new line. For instance <code><nowiki>==Example Heading==</nowiki></code> will look like  
In order to make a heading, type two = before and after your heading on a new line. For instance <code><nowiki>==Example heading==</nowiki></code> will look like  
==Example Heading==
==Example heading==
'''THIS IS AN EXAMPLE'''
'''THIS IS AN EXAMPLE'''


==Sub-headings==
==Sub-headings==
In order to make a sub-heading, type three = before and after your heading on a new line. For instance, <code><nowiki>===Example Sub-heading===</nowiki></code> will look like
In order to make a sub-heading, type three = before and after your heading on a new line. For instance, <code><nowiki>===Example sub-heading===</nowiki></code> will look like
===Example Sub-heading===
===Example sub-heading===
'''THIS IS AN EXAMPLE'''
'''THIS IS AN EXAMPLE'''


==Not Encoding Things==
==Not encoding things==
This is helpful on pages that teach users how to encode text. To un-encode text, type "code <> and immediatly after doing that type "nowiki" between <> then type the code that shouldn't be coded. After typing the code, type </nowiki> immideatly followed by </code>. If you do it right, then <code><nowiki><code><nowiki>'''Example'''</nowiki></code></nowiki></code> will look like <code><nowiki>'''Example'''</nowiki></code> instead of '''Example'''.
This is helpful on pages that teach users how to encode text. To un-encode text, type <code><nowiki><code></nowiki></code> and immediately after doing that type <code><nowiki><nowiki></nowiki></code>; then type the text you don't want to be encoded; after the unencoded text, type <code><nowiki></nowiki></nowiki></code> immediately followed by <code><nowiki></code></nowiki></code>. If you do it right, then <code><nowiki><code></nowiki></code><code><nowiki><nowiki></nowiki></code><code><nowiki>'''Example'''</nowiki></code><code><nowiki></nowiki></nowiki></code><code><nowiki></code></nowiki></code> will look like <code><nowiki>'''Example'''</nowiki></code> instead of '''Example'''.
If this seems to complicated, simply click the button on the editing bar that looks like a W with a red line through it and type the text.
 
Adding code tags is not necessary to prevent encoding, but preferable as it makes it clear that the text is intended to be code. If this seems too complicated, simply click http://bulbapedia.bulbagarden.net/w/skins/common/images/button_nowiki.png on the editing bar with a red line through it and type the text.


==Making Bulleted Lists==
==Making bulleted lists==
To make a bulleted list, type a * before a new line. For example,  
To make a bulleted list, type a * before a new line. For example,  
<br><nowiki>* Bulbasaur</nowiki>
<br><nowiki>* Bulbasaur</nowiki>
Line 198: Line 343:
****Squirtle
****Squirtle


==See Also==
==See also==
[http://meta.wikimedia.org/wiki/Help:Editing Wikimedia's editing help page.]
[http://meta.wikimedia.org/wiki/Help:Editing Wikimedia's editing help page.]

Revision as of 08:48, 30 April 2013

This article will explain the basics of wikicode, giving examples of the various techniques used to make the many pages on Bulbapedia. While this may be helpful, however, the best way to learn is to look at the coding on a page to see how it is done, and modify it to see how it changes—just make sure to make any modifications in a sandbox and use the preview button!

Frequently used text formatting

Edit box code Page appearance
Apostrophes can alter the appearance of text:
*''This is italic text''
*'''This is bold text'''
*'''''This is bold italic text'''''
But watch out that you put the right amount!
*''''This is bold text with badly-formatted apostrophes of fail''''
Apostrophes can alter the appearance of text:
  • This is italic text
  • This is bold text
  • This is bold italic text

But watch out that you put the right amount!

  • 'This is bold text with badly-formatted apostrophes of fail'
You can also indent things!
:Make this line indent once...
::or twice...
::::::::::::or twelve times!
 Just don't do this to indent or you fail at wiki.
You can also indent things!
Make this line indent once...
or twice...
or twelve times!
Just don't do this to indent or you fail at wiki.

Links

Basic link

To link to an article with the same name as the text, put [[ before the text to be linked and ]] after the text.

Example:

[[Vermilion City]]

Will make:

Vermilion City

Piped link

To link to an article with a different name as the text, put [[ before the text to be linked and ]] after it, but, right after the [[, put the title of the article followed by a |.

Example:

[[Ash's Pikachu|his Pikachu]]

Will make:

his Pikachu

Shortlinks

Main article: Bulbapedia:List of link templates

These must be used in articles when necessary.

Example: {{p|Pikachu}}

Will result in:

Pikachu

Instead of:

Pikachu

Interwiki links

Interwiki links can be used to link to other wikis affiliated with Bulbapedia, such as Bulbagarden Archives, Bulbanews, Wikipedia, other members of Encyclopædiæ Pokémonis, and other members of NIWA. To link to another wiki, simply use square brackets like a normal link, but place the prefix at the start of the link.

When linking to an Encyclopædiæ Pokémonis member via this method, there must be a colon : before the prefix, or it will not link correctly.

Example:

[[wp:Pokémon|Pokémon]]

Will make:

Pokémon

Note: most interwiki prefixes have identically named templates, so to link to Wikipedia's article on Pokémon, it can be achieved by typing [[wp:Pokémon|Pokémon]] or {{wp|Pokémon}}.

Incomplete list of interwiki prefixes

Wiki Prefix
Bulbagarden Archives a
Bulbapedia* bp
PokéWiki :de
Donkey Kong Wiki dk
Pokéteca :es
Fire Emblem Wiki few
Poképédia :fr
Golden Sun Universe gsu
Pokémon Central Wiki :it
Pokémon Wiki :ja
Starfy Wiki lsw
Lylat Wiki lw
Nookipedia np
NintendoWiki nw
Metroid Wiki met
MediaWiki mw
Bulbanews n
Pikipedia pk
Wikinezka :pl
LANDpedia :pt
SmashWiki sbw
Super Mario Wiki smw
StrategyWiki strategy
WikiBound wb
Wiktionary wiktionary
WiKirby wk
Wikipedia wp
Wars Wiki ww
Zelda Wiki zw

Incomplete link

Prefix removal

When using interwiki links or linking to pages not in the main namespace, typing [[prefix:Link name|]] causes it to be substituted by [[prefix:Link name|Link name]] after saving the page.

Example:

[[Template:Welcome|]]

Will be substituted to:

[[Template:Welcome|Welcome]]

Will make:

Welcome

This also works for interwiki prefixes. Note that in most cases link templates exist to compensate for this purpose and are preferred.

Parenthesis removal

Linking to a page with parentheses in its title with blank display text results in the display text becoming

Example:

[[Meowth (Team Rocket)|]]

Will be substituted to:

[[Meowth (Team Rocket)|Meowth]]

Will make:

Meowth

Note that in most cases link templates exist to compensate for this purpose and are preferred. When a specific link template does not exist, using {{OBP}} is preferred.

Issues with commas

Linking to a page with one or more commas in the title results in all the text after the comma being cut off.

Example:

[[Get Fired Up, Spiky-eared Pichu!|]]

Will be substituted to:

[[Get Fired Up, Spiky-eared Pichu!|Get Fired Up]]

Will make:

Get Fired Up

Due to this issue, it is recommended to not use this technique when dealing with titles that have commas.

External link

To link to a page outside Bulbapedia and give it a name, write the URL, a space, the name, then finally put brackets around everything, like so: put [ before the url and name and ] after it.

Example:

[http://www.pokemon.com/us/ Official Pokémon website]

Will make:

Official Pokémon website

To link to an external page without giving it a specific name, simply write the URL without any brackets or spaces, like so: http://www.pokemon.com/us/

However, an external picture not in the archives may also be placed with exactly the same technique:

Example: http://www.bulbagarden.net/gateway/banner-pikachu.png

Result: banner-pikachu.png

Note that this is not to be done in mainspace articles.

Table

To make a table, first type {| at the beginning of a new line. Then, on each line after that, put a | before the text, to make it be part of the table, on the same row. To make a new row, type |- on a new line and continue like normal. To end the table, type, on a new line, |}

Example:

{|
|Bulbasaur
|Grass
|-
|Charmander
|Fire
|-
|Squirtle
|Water
|}

Will make:

Bulbasaur Grass
Charmander Fire
Squirtle Water

Categories

To add a page to a category, put [[Category:(category name)]] anywhere on the page, though in almost all cases it is better to put them near the bottom of the page for the convenience of other editors. This will add the category of the page to the bottom, as well as put a link to that page on the category's page.

Example: [[Category:Trainers]] would add this page to the category of Trainers.

To link to a category without , put a colon before "Category" in the link. For example, to link to the category "Trainers", [[:Category:Trainers]] would give the category without adding this page to the Trainers category.

Personal CSS

It is possible for each user to customize their CSS to change the appearance of Bulbapedia. The changes only take effect for a user when he/she is logged in. To edit the CSS, a user should type in "User:username/monobook.css". IMPORTANT:The word "monobook" MUST be lowercase!

The user can then create an addition to the Bulbapedia CSS. An example of some personal CSS is:

.googleContent {display: none}
.firstHeading {position: absolute; top: 63px; width: 900px}
#bodyContent {position: absolute; top: 101px; width: 900px}
.pBody {background: transparent; border: none}
#p-personal {position: fixed; top: 0px; z-index: 100}
#p-navigation {position: fixed; top: 159px; z-index: 100}
#p-search {position: fixed; top: 297px; z-index: 100}
#p-tb {position: fixed; top: 365px; z-index: 100}
#p-lang {position: fixed; top: 507px; z-index: 100}
#footer {display: none}

This CSS will hide the ads while keeping the header at the top of the page the same distance from the top. It also hides the footer and causes the userbar at the top (User, my talk, my preferences, my watchlist, my contributions, log out) and the navigation, search, and toolbox menus on the left to stay in the same position even when the user scrolls down, eliminating the need to scroll back to the top of the page to go to a new page or go to his/her userpage.

Undoing an edit

This action should be taken in the case of a vandal or a mistake. To do this, click on the history tab at the top of the page (one can also press the 'Alt' button and 'h' at the same time and then press 'enter'). Then, from the list, select the edit that needs to be undone. Click 'Save Page' and the action is complete. As complicated as this might be, this should be done as quickly as possible in the case of a vandal.

Headings

In order to make a heading, type two = before and after your heading on a new line. For instance ==Example heading== will look like

Example heading

THIS IS AN EXAMPLE

Sub-headings

In order to make a sub-heading, type three = before and after your heading on a new line. For instance, ===Example sub-heading=== will look like

Example sub-heading

THIS IS AN EXAMPLE

Not encoding things

This is helpful on pages that teach users how to encode text. To un-encode text, type <code> and immediately after doing that type <nowiki>; then type the text you don't want to be encoded; after the unencoded text, type </nowiki> immediately followed by </code>. If you do it right, then <code><nowiki>'''Example'''</nowiki></code> will look like '''Example''' instead of Example.

Adding code tags is not necessary to prevent encoding, but preferable as it makes it clear that the text is intended to be code. If this seems too complicated, simply click button_nowiki.png on the editing bar with a red line through it and type the text.

Making bulleted lists

To make a bulleted list, type a * before a new line. For example,
* Bulbasaur
* Squirtle
* Charmander
This should come out as:

  • Bulbasaur
  • Squirtle
  • Charmander

To make indents with bullets, put more *s, depending on how much you want to indent it.
**Bulbasaur
***Charmander
****Squirtle
This comes out as:

    • Bulbasaur
      • Charmander
        • Squirtle

See also

Wikimedia's editing help page.