User:Proteins/Wiki markup: Difference between revisions
→Article basics: briefer, swap images and references to put more complex later |
→Templates and tables: set up example for tables |
||
Line 174: | Line 174: | ||
| colspan=4 style="background-color:lightblue;" | Templates are used to include the same material in multiple pages; this is called ''transcluding''. The advantage is that this material is stored only once, but appears on many pages. Thus, a change to the master copy appears immediately on all of the transcluding pages. Templates are often used to establish a common format across many articles. |
| colspan=4 style="background-color:lightblue;" | Templates are used to include the same material in multiple pages; this is called ''transcluding''. The advantage is that this material is stored only once, but appears on many pages. Thus, a change to the master copy appears immediately on all of the transcluding pages. Templates are often used to establish a common format across many articles. |
||
|- |
|- |
||
| rowspan=2 | <span id="tables"></span>'''Tables''' |
| rowspan=2 | <span id="tables"></span>'''Tables''' |
||
| |
|||
{| class="wikitable sortable" |
|||
|+ Table caption |
|||
! Heading 1 !! Heading 2 !! etc. |
|||
|- |
|||
| Row 1, column 1 || Row 1, column 2 || etc. |
|||
|- |
|||
| Row 2, column 1 || Row 2, column 2 || etc. |
|||
|} |
|||
| style="text-align:left;" | <font color="red"><nowiki>{| class="wikitable sortable"</nowiki></font><br /><font color="red"><nowiki>|+</nowiki></font>Table caption<br /><font color="red"><nowiki>!</nowiki></font> Heading 1 <font color="red"><nowiki>!!</nowiki></font> Heading 2 <font color="red"><nowiki>!!</nowiki></font> etc.</font><br /><font color="red"><nowiki>|-</nowiki></font><br /><font color="red"><nowiki>|</nowiki></font> Row 1, column 1 <font color="red"><nowiki>||</nowiki></font> Row 1, column 2 <font color="red"><nowiki>||</nowiki></font> etc.<br /><font color="red"><nowiki>|+</nowiki></font><br /><font color="red"><nowiki>|</nowiki></font> Row 2, column 1 <font color="red"><nowiki>||</nowiki></font> Row 2, column 2 <font color="red"><nowiki>||</nowiki></font> etc.</font><br /><font color="red"><nowiki>|}</nowiki></font> || none || <font color="green">'''Common'''</font> |
|||
|- |
|- |
||
| colspan=4 style="background-color:lightblue;" | Tables are probably the most difficult wiki-markup to learn. |
| colspan=4 style="background-color:lightblue;" | Tables are probably the most difficult wiki-markup to learn. |
Revision as of 11:36, 17 July 2009
Wiki-markup is a set of commands to specify how an article should look. This markup is incorporated into the article; it is invisible to readers, but becomes apparent as soon as you click on the edit this page tag. If you wish to contribute to Wikipedia, it is essential that you learn wiki-markup, at least the basic elements.
The following tables are designed to help you learn wiki-markup. The first two tables present the most basic and commonly used wiki-markup, whereas later tables show wiki-markup of ever greater complexity. All the tables highlight the wiki-markup in red, and show examples of the results. They also describe the customary way these markup commands are used on Wikipedia, with links to the Wikipedia's Manual of Style for more details.
Wiki-markup is a shorthand for HTML markup. It replaces HTML tags with punctuation marks that are very rare in normal text, such as a double square bracket, double equal signs, or double single quotes. If you know HTML tags, learning wiki markup should be relatively easy. The HTMl equivalents are also given in the tables below.
A simpler version of this page can be found at WP:CHEAT ("the cheat sheet").
Article basics
Description | Example | Wiki | HTML tag | Usage |
---|---|---|---|---|
Paragraphs | blank line | <p>text</p> | Common | |
Paragraphs are separated by a exactly one blank line. They are the most common, but most invisible, markup. | ||||
Wikilinks |
DNA | [[DNA]] (2 square brackets) | <a href="DNA">text</a> | Common |
Wikilinks are the bread-&-butter of Wikipedia, and part of the reason for its success. They can be used in lieu of a detailed explanation — and to reconcile the need to be accurate yet intelligible to lay-people. If readers wish to know more about the topic, they can click on the link. | ||||
Headings |
==Section heading== (2 equal signs) ===Subsection heading=== (3 equal signs) ====Subsubsection heading==== (4 equal signs) |
<h2>text</h2> <h3>text</h3> <h4>text</h4> |
Common | |
Headings are essential for organizing the articles. However, you should never create an H1 heading with one equal sign, e.g., =Subsection heading=. | ||||
References |
Assertion.[1] | Assertion.<ref>Text</ref> | none | Common |
References are essential for Wikipedia's reliability. They are placed after the assertion and any adjacent punctuation, such as a period or comma. They appear as superscripted numbers that link to a "References" section at the end of the article. | ||||
Images |
[[DNA_replication.svg|thumb|left|120px|Diagram of DNA replication]] (2 square brackets + parameters) | <img src="DNA_replication.svg" width="120" /> | Common | |
In this example, \"thumb\" allows for a caption, \"left\" aligns the image on the left margin, and \"120px\" sets the width in pixels. The final parameter is the caption. |
Talk-page basics
Description | Example | Wiki | HTML tag | Usage |
---|---|---|---|---|
Signature |
Proteins (talk) 13:16, 11 July 2009 (UTC) | ~~~~ (4 tildes) | none | Common |
You should append your signature to every Talk-page message you write, to identify yourself as the speaker. However, signatures should never appear in an article. | ||||
Indentation | Previous sentence. |
Previous sentence. :Indented text (1 colon) ::Doubly indented text (2 colons), etc. |
Previous sentence. <dd>Indented text</dd> |
Common |
Wikipedians often indent their messages on Talk pages when they reply to another person's message. The colons must be the first characters on a new line. There is no limit to the number of colons (indentation levels); in practice, however, it is rare to see more than 10 levels, since people "outdent" to have more space. | ||||
Bulleted list |
<nowiki>text with wiki-markup such as [[DNA]]</nowiki> | none | Rare | |
To turn off the interpretation of wiki-markup, enclose the text in <nowiki>...</nowiki> tags. |
Font effects
Description | Example | Wiki | HTML tag | Usage |
---|---|---|---|---|
Italics |
text | ''text'' (2 single quotes) | <em>text</em> | Rare |
Italics are used mainly in references such as Journal of Molecular Biology, in taxonomic names such as Vibrio cholerae. In general, italics should not be used for emphasis. | ||||
Bold |
text | '''text''' (3 single quotes) | <b>text</b> | Rare |
Boldface text is generally used only once in an article, to highlight the article topic in the first sentence of the lead. In general, boldface type should not be used for emphasis. | ||||
Superscript Subscript |
atext btext |
a<sup>text</sup> (enclose in sup tags) b<sub>text</sub> (enclose in sub tags) |
identical | Rare |
Super- and subscripts are used mainly in mathematical formulae. They are preferable to math mode (see below) because they do not require ALT text. | ||||
Strike |
<s>text</s> (enclose in s tags) | identical | Rare | |
Strikethrough text is used mainly when reviewing articles on Wikipedia, to show that a criticism has been satisfied. | ||||
Small |
Normal text small text | <small>text</small> (enclose in small tags) | identical | Rare |
Small font is used mainly to indicate that the text describes a minor detail. |
Lists and links
Multimedia
Templates and tables
Description | Example | Wiki | HTML tag | Usage | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Templates | {{page being transcluded}} (2 curly braces) | none | Common | ||||||||||
Templates are used to include the same material in multiple pages; this is called transcluding. The advantage is that this material is stored only once, but appears on many pages. Thus, a change to the master copy appears immediately on all of the transcluding pages. Templates are often used to establish a common format across many articles. | |||||||||||||
Tables |
|
{| class="wikitable sortable" |+Table caption ! Heading 1 !! Heading 2 !! etc. |- | Row 1, column 1 || Row 1, column 2 || etc. |+ | Row 2, column 1 || Row 2, column 2 || etc. |} |
none | Common | |||||||||
Tables are probably the most difficult wiki-markup to learn. |
Miscellany
Description | Example | Wiki | HTML tag | Usage |
---|---|---|---|---|
No wiki |
<nowiki>text with wiki-markup such as [[DNA]]</nowiki> | none | Rare | |
To turn off the interpretation of wiki-markup, enclose the text in <nowiki>...</nowiki> tags. | ||||
Hidden comment |
<!-- Hidden comment --> | identical | Rare | |
Hidden comments are used mainly to explain why certain editorial choice were made. They are also used to dissuade new editors to the article from making common mistakes. | ||||
Math mode |
<math>\sin\theta = \frac{a}{\sqrt{a^{2} + b^{2}}}</math> | none | Rare | |
Beautifully formatted mathematical formulae can be obtained by enclosing LaTeX commands in <math> tags. To make these formulae accessible to visually impaired readers, the math tag should have ALT text enclosed in double quotes, e.g., <math alt="The sine of theta equals a divided by the square root of a squared plus b squared.">\sin\theta = \frac{a}{\sqrt{a^{2} + b^{2}}}</math>. | ||||
Footnotes | Assertion.[note 1] | Assertion.<ref group=note>Explanatory text.</ref> | none | Common |
Footnotes are not citations to the scholarly literature, but rather explanatory notes that would otherwise interrupt the flow of the writing. Similar to references, they are placed after the assertion being clarified and any adjacent punctuation, such as a period or comma. They appear as superscripted numbers that link to a "Footnotes" section at the end of the article. |
Special text formatting
Deprecated
Although wiki-markup allows for them, these HTML elements should not be used on Wikipedia.
Description | Example | Wiki | HTML tag | Usage |
---|---|---|---|---|
H1 headings | =H1 heading= (1 equal sign) | <h1>text</h1> | NEVER | |
H1 headings should never be used on Wikipedia because the article name at the top of the page is the H1 heading. | ||||
Horizontal rule | ---- (4 hyphens) | <hr> | NEVER | |
Horizontal rules should never be used on Wikipedia. |
Footnotes
- ^ Explanatory text.
References
- ^ Text