User:Buggie111/Adopt/Wikicode

From Wikipedia, the free encyclopedia

In Wikipedia, not all text is WYSIWYG (What you see is what you get). Most of the special mark up, (i.e. bolding, italics, etc.) are written via wikicode. More complicated stuff is also via wikicode, but we'll cover the easy stuff first.

Sections and Spacing[edit]

To write anything comprehensible, you have to divide your writing into sections. This is easily done in Wikipedia by putting = around both sides of your section. Usually, you put at least two = at each end of the section title. 1 "equals" is rarely used. Do not skip levels (from 2 to 4), it messes up the code. To create a horizontal line, use ----. To put in a line break, use

Table of contents[edit]

By default, pages generate table of contents when they have at least 4 sections. To add one when you have three sections or less, put in __TOC__. Likewise, to remove one, put in __NOTOC__.

Indent text[edit]

What you type What it looks like

Left indent

:A colon at the start of a line
::causes the line to be indented,
:::most commonly used on Talk pages.
A colon at the start of a line
causes the line to be indented,
most commonly used on Talk pages.

Blockquote

When there is a need for separating a block of text. This is useful for (as the name says) inserting blocks of quoted (and cited) text.

<blockquote> The '''blockquote''' tag will indent both margins when needed instead of the left margin only as the colon does. </blockquote>

The blockquote tag will indent both margins when needed instead of the left margin only as the colon does.

Center text[edit]

What you type What it looks like
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">Centered text</div>
Centered text

Template {{center}} uses the same markup. To center a table, see Help:Table#Centering tables.

Lists[edit]

What you type What it looks like
* ''Unordered lists'' are easy to do:
** Start every line with a star.
*** More stars indicate a deeper level.
**: Previous item continues.
** A new line
* in a list
marks the end of the list.
* Of course you can start again.
  • Unordered lists are easy to do:
    • Start every line with a star.
      • More stars indicate a deeper level.
      Previous item continues.
    • A new line
  • in a list

marks the end of the list.

  • Of course you can start again.
# ''Numbered lists'' are:
## Very organized
## Easy to follow
#: Previous item continues
A new line marks the end of the list.
# New numbering starts with 1.
  1. Numbered lists are:
    1. Very organized
    2. Easy to follow
    Previous item continues

A new line marks the end of the list.

  1. New numbering starts with 1.

Format[edit]

Text formatting[edit]

Description What you type What it looks like

Italics, bold, small capital letters.

To ''italicize text'', just put
2 apostrophes on each side.

3 apostrophes will '''bold the text'''

5 apostrophes for '''''bold italics'''''

For text as {{Smallcaps|small caps}},
that uses a [[Help:Template|template]].

; A lead semicolon bolds an entire line.
Semicolons (";") must start each line.
Often, it is used for section headers
(see [[#Sections|above]]).

To italicize text, just put 2 apostrophes on each side.

3 apostrophes will bold the text

5 apostrophes for bold italics

For text as small caps, that uses a template.

A lead semicolon bolds an entire line.

Semicolons (";") must start each line. Often, it is used for section headers (see above).

Syntax highlighting for source code.

Computer code has colored text and more stringent formatting. For example, to define a function: int m2(), with highlights.

<syntaxhighlight lang="cpp">
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}</syntaxhighlight>
#include <iostream>
int m2 (int ax, char *p_ax) {
  std::cout <<"Hello World!";
  return 0;
}

Small text.

Use <small>small text</small> if needed.

A span tag can set text font-size as
being <span style="font-size:87%">87%
of prior size</span>, to match an
image caption.

Use small text if needed.

A span tag can set text font-size as being 87% of prior size, to match an image caption.

Big text.

Better not use <big>big text</big>,
unless <small> it's <big>within</big>
small</small> text.

Better not use big text, unless it's within small text.

You can include a non-breaking space (sometimes called non-printing character) where you require two words to always appear together on the same line, such as Mr. Smith or 400 km/h, using &nbsp; in place of a regular space between the two "words" that need to behave as a single word (never be separated on different lines).

Mr.&nbsp;Smith or 400&nbsp;km/h.

Mr. Smith or 400 km/h.

Extra spacing within text can best be achieved using the pad template.

Mary {{pad|4em}} had a little lamb.

Mary   had a little lamb.

Typewriter font.

(Does also work beyond the end of a paragraph.)

<tt>arrow      &rarr;</tt>

<tt>''italics'', '''bold'''</tt>

<tt><nowiki>[[link]]

New paragraph </tt>started here.

arrow →

italics, bold

link

New paragraph started here.

Subscripts and superscripts[edit]

  • The Manual of Style prefers the x<sub>1</sub> format.
  • The latter methods of sub/superscripting cannot be used in the most general context, as they rely on Unicode support which may not be present on all users' machines. For the 1-2-3 superscripts, it is nevertheless preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.
Description What you type What it looks like

Subscripts

x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> or 
x&#8320; x&#8321; x&#8322; x&#8323; x&#8324; 
x&#8325; x&#8326; x&#8327; x&#8328; x&#8329;

x1 x2 x3 or
x₀ x₁ x₂ x₃ x₄
x₅ x₆ x₇ x₈ x₉

Superscripts

x<sup>1</sup> x<sup>2</sup> x<sup>3</sup> or 
x&#8304; x&sup1; x&sup2; x&sup3; x&#8308; 
x&#8309; x&#8310; x&#8311; x&#8312; x&#8313;

x1 x2 x3 or
x⁰ x¹ x² x³ x⁴
x⁵ x⁶ x⁷ x⁸ x⁹

Combined

&epsilon;<sub>0</sub> = 8.85 &times; 10<sup>&minus;12</sup> C&sup2; / J m

1 [[hectare]] = [[1 E4 m&sup2;]]

ε0 = 8.85 × 10−12 C² / J m

1 hectare = 1 E4 m²

Greek characters[edit]

What you type What it looks like
&alpha; &beta; &gamma; &delta; &epsilon; &zeta; 
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu; 
&xi; &omicron; &pi; &rho; &sigma; &sigmaf; 
&tau; &upsilon; &phi; &chi; &psi; &omega; 
&Alpha; &Beta; &Gamma; &Delta; &Epsilon; &Zeta; 
&Eta; &Theta; &Iota; &Kappa; &Lambda; &Mu; 
&Nu; &Xi; &Omicron; &Pi; &Rho; &Sigma; 
&Tau; &Upsilon; &Phi; &Chi; &Psi; &Omega; 

α β γ δ ε ζ
η θ ι κ λ μ ν
ξ ο π ρ σ ς
τ υ φ χ ψ ω
Α Β Γ Δ Ε Ζ
Η Θ Ι Κ Λ Μ
Ν Ξ Ο Π Ρ Σ
Τ Υ Φ Χ Ψ Ω

Mathematical characters[edit]

What you type What it looks like
&int; &sum; &prod; &radic; 
&minus; &plusmn; &infin; 
&asymp; &prop; &equiv; &ne; 
&le; &ge; 
&times; &middot; &divide; &part; 
&prime; &Prime; 
&nabla; &permil; &deg; &there4; &alefsym; 
&oslash; 
&isin; &notin; &cap; &cup; 
&sub; &sup; &sube; &supe; 
&not; &and; &or; &exist; &forall; 
&rArr; &lArr; &dArr; &uArr; &hArr; 
&rarr; &darr; &uarr; &larr; &harr; 

∫ ∑ ∏ √
− ± ∞
≈ ∝ ≡ ≠
≤ ≥
× · ÷ ∂
′ ″
∇ ‰ ° ∴ ℵ
ø
∈ ∉ ∩ ∪
⊂ ⊃ ⊆ ⊇
¬ ∧ ∨ ∃ ∀
⇒ ⇐ ⇓ ⇑ ⇔
→ ↓ ↑ ← ↔

Mathematical formulae[edit]

  • Formulae that include mathematical letters, like x, and operators like × should not use the plain letter x. See math font formatting. For a comprehensive set of symbols, and comparison between <math> tags and the {{math}} template see section TeX vs HTML.
  • The <math> tag typesets using LaTeX markup, which may render as an image or as HTML, depending on environmental settings. The <math> tag is best for the complex formula on its own line in an image format. If you use this tag to put a formula in the line with text, put it in the {{nowrap}} template.
  • The {{math}} template uses HTML, and will size-match a serif font, and will also prevent line-wrap. All templates are sensitive to the = sign, so remember to replace = with {{=}} in template input. Use wikimarkup '' and ''' inside the {{math}} template, as well other HTML entities. The {{math}} template is best for typeset formulas in line with the text.
Markup Renders as
<math>2x \times 4y \div 6z + 8
   - \frac {y}{z^2} = 0</math>
{{crlf|}}

{{math|2x &times; 4y &divide;
6z + 8 &minus; {{Fraction
  |y|z<sup>2</sup>}} {{=}} 0}}


<math>\sin 2\pi x + \ln e\,\!</math>
<math>\sin 2\pi x + \ln e</math>
{{math|sin 2&pi;''x'' + ln ''e''}}


2x × 4y ÷ 6z + 8 − yz2 = 0




sin 2πx + ln e

Spacing in simple math formulae[edit]

  • Using &nbsp; to prevent linebreak is not needed; the {{math}} template will prevent line breaks anyway; you can use <br/> if you need an explicit line break inside a formula.
What you type What it looks like
It follows that {{math
|''x''<sup>2</sup> &ge; 0}} is true when {{math|<VAR>x</VAR>}} is a real number.

It follows that x2 ≥ 0 is true when x is a real number.

Complicated formulae[edit]

  • See Help:Displaying a formula for how to use <math>.
  • A formula displayed on a line by itself should probably be indented by using the colon (:) character.
What you type What it looks like
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math>

Links[edit]

Linking between Wikipedia articles is simple. Just add [[ and ]] to either end of the article's title. To customize the title, add | in between the title and the ]], then add your custom title. Links outside of Wikipedia are created by adding a single bracket to either side. To add a custom title to these links, space between the end of the url and the end bracket, then add your text. Links with incorrect titles will become red.

Link to a section of a page[edit]

  • The part after the number sign (#) must match a section heading on the page. Matches must be exact in terms of spelling, case, and punctuation. Links to non-existent sections are not broken; they are treated as links to the top of the page.
  • Include "| link title" to create a stylish (piped) link title.
  • If sections have the same title, add a number to link to any but the first. #Example section 3 goes to the third section named "Example section". You can use the pipe and retype the section title to display the text without the # symbol.
What you type What it looks like

[[Wikipedia:Manual of Style#Italics]] is a link to a section within another page.

Wikipedia:Manual of Style#Italics is a link to a section within another page.

[[#Links and URLs]] is a link to another section on the current page. [[#Links and URLs|Links and URLs]] is a link to the same section without showing the # symbol.

#Links and URLs is a link to another section on the current page. Links and URLs is a link to the same section without showing the # symbol.

[[Wikipedia:Manual of Style#Italics|Italics]] is a piped link to a section within another page.

Italics is a piped link to a section within another page.

Create page link[edit]

  • To create a new page:
    1. Create a link to it on some other (related) page.
    2. Save that page.
    3. Click on the link you just made. The new page will open for editing.
  • For more information, see starting an article and check out Wikipedia's naming conventions.
  • Please do not create a new article without linking to it from at least one other article.
Description What you type What it looks like

Links to pages that don’t exist yet look red.

The article about [[cardboard sandwiches]] doesn't exist yet.

The article about cardboard sandwiches doesn't exist yet.

Redirects[edit]

  • Redirect one article title to another by placing a directive like the one shown to the right on the first line of the article (such as at a page titled "USA").
  • It is possible to redirect to a section. For example, a redirect to United States#History will redirect to the History section of the United States page, if it exists.
Description What you type

Redirect to an article.

#REDIRECT [[United States]]

Redirect to a section.

#REDIRECT [[United States#History]]

Link to another namespace[edit]

What you type What it looks like

See the [[Wikipedia:Manual of Style]].

See the Wikipedia:Manual of Style.

Link to the same article in another language (interlanguage links)[edit]

  • To link to a corresponding page in another language, use the form: [[language code:Foreign Title]].
  • It is recommended interlanguage links be placed at the very end of the article.
  • Interlanguage links are not visible within the formatted article, but instead appear as language links on the sidebar (to the left) under the menu section "languages".
  • For further help, please see Interlanguage links and the Complete list of language wikis available.

NOTE: To create an inline link (a clickable link within the text) to any foreign language article, see Inline interlanguage links and consider the usage notes.

Description What you type

Link from English article "Plankton" to the Spanish article "Plancton".
"es" is the language code for "español" (the Spanish language).

[[es:Plancton]]

Other examples: German (de for Deutsch), Russian (ru), and simple English (simple).

[[de:Plankton]] [[ru:Планктон]] [[simple:Plankton]]

Interwiki link[edit]

Description What you type What it looks like

Linking to a page on another wiki in English.

All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello.

Simple link.

Without prefix.

Named link.

[[Wiktionary:Hello]]

[[Wiktionary:Hello|]]

[[Wiktionary:Hello|Wiktionary definition of "Hello"]]

Wiktionary:Hello

Hello

Wiktionary definition of "Hello"

Linking to a page on another wiki in another language.

All of these forms lead to the URL http://fr.wiktionary.org/wiki/bonjour.

Simple link.

Without prefix.

Named link.

[[Wiktionary:fr:bonjour]]

[[Wiktionary:fr:bonjour|]]

[[Wiktionary:fr:bonjour|bonjour]]

Wiktionary:fr:bonjour

fr:bonjour

bonjour

Categories[edit]

  • To put an article in a category, place a link like the one to the right anywhere in the article. As with interlanguage links, placing these links at the end of the edit box is recommended.
  • To link to a category page without putting the article into the category, use a colon prefix (":Category") in the link.
Description What you type What it looks like

Categorize an article.

[[Category:Character sets]]

Link to a category.

[[:Category:Character sets]]

Category:Character sets

Without prefix.

[[:Category:Character sets|]]

Character sets

Images[edit]

Only images that have been uploaded to Wikipedia can be used. To upload images, use the upload page. You can find the uploaded image on the image list.

What you type What it looks like Notes
A picture:
[[File:wiki.png]]
A picture:

With alternative text:
[[File:wiki.png|alt=Puzzle globe logo]]
With alternative text:

Puzzle globe logo

  • Alternative text, used when the image is unavailable or when the image is loaded in a text-only browser, or when spoken aloud, is strongly encouraged. See Alternative text for images for help on choosing it.
With link:
[[File:wiki.png|link=Wikipedia]]
With link:


  • Links direct to a page instead of the file.
Floating to the right side of the page using the ''frame'' attribute and a caption:
[[File:wiki.png|frame|alt=Puzzle globe|Wikipedia logo]]
Floating to the right side of the page using the frame attribute and a caption:
Puzzle globe
Wikipedia logo

  • The frame tag automatically floats the image right.
  • The last parameter is the caption that appears below the image.
Floating to the right side of the page using the ''thumb'' attribute and a caption:
[[File:wiki.png|thumb|alt=Puzzle globe|Wikipedia logo]]
Floating to the right side of the page using the thumb attribute and a caption:
Puzzle globe
Wikipedia logo

  • The thumb tag automatically floats the image right.
  • An enlarge icon is placed in the lower right corner.
Floating to the right side of the page ''without'' a caption:
[[File:wiki.png|right|Wikipedia encyclopedia]]
Floating to the right side of the page without a caption:
Wikipedia encyclopedia
Wikipedia encyclopedia
A picture resized to 30 pixels...
[[File:wiki.png|30 px|Wikipedia encyclopedia]]
A picture resized to 30 pixels...

Wikipedia encyclopedia

Linking directly to the description page of an image:
[[:File:wiki.png]]
Linking directly to the description page of an image:

File:wiki.png

  • Clicking on an image displayed on a page (such as any of the ones above) also leads to the description page.
Linking directly to an image without displaying it:
[[Media:wiki.png|Image of jigsaw globe]]
Linking directly to an image without displaying it:

Image of jigsaw globe

  • To include links to images shown as links instead of drawn on the page, use a "media" link.
Example:
<div style="display:inline; width:220px; float:right;">
Place images here </div>

Example:

Place images here

Using the span or div elements to separate images from text (note that this may allow images to cover text).

Example:

{| align=right
|-
| 
Place images here
|}

Example:

Place images here

Using wiki markup to make a table in which to place a vertical column of images (this helps edit links match headers, especially in Firefox browsers).

See the Wikipedia's image use policy as a guideline used on Wikipedia.

For further help on images, including some more versatile abilities, see the picture tutorial.

Tables[edit]

There are two ways to build tables:

  • In special wiki-markup (see Table).
  • Using HTML elements: <table>, <tr>, <td> or <th>.

See also When tables are appropriate.

References and citing sources[edit]

Making a reference citing a printed or online source can be accomplished by using the ref tag. Inside the reference tag details about the reference are added. You can add additional attributes to add detail about the source and reference, a pipe (|) precedes each reference, each attribute goes inside the cite portion of the tag.

What it's for What you type
For creating the reference <ref name="name for reference">Use a closing tag</ref>
When you cite a book {{cite book}}
To cite a web source {{cite web}}
Book ISBN |isbn=0-8018-6646-4 (ISBN of the book)
Web URL |url=http://www.wikipedia.org
Title |title=title of source
Author |author=authors, use commas for multiple
First name |first=first name
Last name |last=last name
Location |location=location of occurrence
Publisher |publisher=who published the source
Date |date=2007-03-04 (date of source)
Year |year=year of source
Accessed date |accessdate=2008-12-07
A complete reference tag <ref name="WikiMarkup">{{cite web |url=http://en.wikipedia.org/w/index.php?title=Help:Wiki_markup |title=Help:Wiki markup |publisher=Wikimedia Foundation}}</ref>
Referencing this again <ref name="WikiMarkup"/>
Citation needed {{citation needed}}

What links here and related changes[edit]

What you type What it looks like

[[Special:WhatLinksHere/aaa]]

Special:WhatLinksHere/aaa

[[Special:RecentChangesLinked/aaa]]

Special:RecentChangesLinked/aaa

Linking to old revisions of pages, diffs, and specific history pages[edit]

  • External link function is used for these.
  • Open an old revision or diff and copy the URL from the address bar, pasting it where you want it.
What you type What it looks like

[http://en.wikipedia.org/w/index.php?title=Help:Wiki_markup&diff=330350877&oldid=330349143 previous edit]

previous edit

Nowiki[edit]

In some instances, we don't want our markup to be parsed as markup, so we enclose it in <nowiki>...</nowiki> tags. <nowiki> is a parser tag that causes the included content to not be parsed as wikimarkup, except for HTML entities. It is useful in documentation to display markup.

Markup Renders as
<nowiki>{{cite book}}</nowiki>

{{cite book}}

A singular <nowiki /> can be used to break wikimarkup.

Variables[edit]

Some "Magic Words" can be used to add in information like the date, month, etc. They are as follows:

Code Effect Notes
{{CURRENTWEEK}} 20
{{CURRENTDOW}} 5

Monday = 1, Tuesday = 2, etc., but Sunday = 0

{{CURRENTMONTH}} 05
{{CURRENTMONTHNAME}} May
{{CURRENTMONTHNAMEGEN}} May
{{CURRENTDAY}} 17
{{CURRENTDAYNAME}} Friday
{{CURRENTYEAR}} 2024
{{CURRENTTIME}} 20:41
{{NUMBEROFARTICLES}} 6,824,698
{{NUMBEROFPAGES}} 60,681,820
{{NUMBEROFUSERS}} 47,414,602
{{PAGENAME}} Buggie111/Adopt/Wikicode
{{NAMESPACE}} User
{{REVISIONID}} -
{{REVISIONUSER}} Buggie111
{{localurl:pagename}} /wiki/Pagename
{{localurl:Wikipedia:Sandbox|action=edit}} /w/index.php?title=Wikipedia:Sandbox&action=edit
{{fullurl:pagename}} //en.wikipedia.org/wiki/Pagename
{{fullurl:pagename|query_string}} //en.wikipedia.org/w/index.php?title=Pagename&query_string
{{SERVER}} //en.wikipedia.org
{{ns:1}} Talk

{{ns:index}} e.g. {{ns:1}} → full name of namespace

{{SITENAME}} Wikipedia

Assignment[edit]

Replace "USER" with your username.