| 1 |
= Help:Wikitext examples = |
| 2 |
|
| 3 |
https://meta.wikimedia.org/wiki/Help:Wikitext_examples |
| 4 |
|
| 5 |
== Basic text formatting == |
| 6 |
|
| 7 |
You can ''italicize'' text by putting 2 apostrophes on ''each'' side. |
| 8 |
|
| 9 |
3 apostrophes will '''bold''' the text. |
| 10 |
|
| 11 |
5 apostrophes will '''''bold and italicize''''' the text. |
| 12 |
|
| 13 |
(Using 4 apostrophes doesn't do anything special -- <br /> 3 of them '''bold''' the text as usual; the others are ''''just'''' apostrophes around the text.) |
| 14 |
|
| 15 |
---- |
| 16 |
|
| 17 |
A single newline generally has no effect on the layout. These can be used to separate sentences within a paragraph. Some editors find that this aids editing and improves the ''diff'' function (used internally to compare different versions of a page). |
| 18 |
|
| 19 |
But an empty line starts a new paragraph. |
| 20 |
|
| 21 |
When used in a list, a newline ''does'' affect the layout ([[#lists|see below]]). |
| 22 |
|
| 23 |
---- |
| 24 |
|
| 25 |
You can break lines<br/> |
| 26 |
without a new paragraph.<br/> |
| 27 |
Please use this sparingly. |
| 28 |
|
| 29 |
Please do not start a link or ''italics'' or '''bold''' text on one line and end on the next. |
| 30 |
|
| 31 |
---- |
| 32 |
|
| 33 |
You should "sign" your comments on talk pages: |
| 34 |
* Three tildes gives your signature: ~~~ |
| 35 |
* Four tildes give your signature plus date/time: ~~~~ |
| 36 |
* Five tildes gives the date/time alone: ~~~~~ |
| 37 |
|
| 38 |
|
| 39 |
== HTML tags == |
| 40 |
|
| 41 |
Put text in a <kbd>monospace ('typewriter') font</kbd>. The same font is generally used for <code>computer code</code>. |
| 42 |
|
| 43 |
---- |
| 44 |
|
| 45 |
<strike>Strike out</strike> or <u>underline</u> text, or write it <span style="font-variant:small-caps">in small caps</span>. |
| 46 |
|
| 47 |
---- |
| 48 |
|
| 49 |
Superscripts and subscripts: X<sup>2</sup>, H<sub>2</sub>O |
| 50 |
|
| 51 |
---- |
| 52 |
|
| 53 |
<center>Centered text</center> |
| 54 |
* Please note the American spelling of "center". |
| 55 |
|
| 56 |
---- |
| 57 |
|
| 58 |
* This is how to {{Font color||yellow|highlight part of a sentence}}. |
| 59 |
|
| 60 |
---- |
| 61 |
|
| 62 |
<blockquote> |
| 63 |
The '''blockquote''' command ''formats'' block quotations, typically by surrounding them with whitespace and a slightly different font. |
| 64 |
</blockquote> |
| 65 |
|
| 66 |
---- |
| 67 |
|
| 68 |
Invisible comments to editors (<!-- -->) appear only while editing the page. |
| 69 |
<!-- Note to editors: blah blah blah. --> |
| 70 |
|
| 71 |
|
| 72 |
== Organizing your writing == |
| 73 |
|
| 74 |
== Section headings == |
| 75 |
|
| 76 |
''Headings'' organize your writing into sections. The ''Wiki'' software can automatically generate a [[help:Section|table of contents]] from them. |
| 77 |
|
| 78 |
=== Subsection === |
| 79 |
Using more "equals" (=) signs creates a subsection. |
| 80 |
|
| 81 |
==== A smaller subsection ==== |
| 82 |
|
| 83 |
Don't skip levels, like from two to four equals signs. |
| 84 |
|
| 85 |
Start with 2 equals signs, not 1. If you use only 1 on each side, it will be the equivalent of h1 tags, which should be reserved for page titles. |
| 86 |
|
| 87 |
---- |
| 88 |
|
| 89 |
* ''Unordered lists'' are easy to do: |
| 90 |
** Start every line with a asterisk. |
| 91 |
*** More asterisks indicate a deeper level. |
| 92 |
*: Previous item continues. |
| 93 |
** A newline |
| 94 |
* in a list |
| 95 |
marks the end of the list. |
| 96 |
*Of course you can start again. |
| 97 |
|
| 98 |
---- |
| 99 |
|
| 100 |
# ''Numbered lists'' are: |
| 101 |
## Very organized |
| 102 |
## Easy to follow |
| 103 |
A newline marks the end of the list. |
| 104 |
# New numbering starts with 1. |
| 105 |
|
| 106 |
---- |
| 107 |
|
| 108 |
Here's a ''definition list'': |
| 109 |
; Word : Definition of the word |
| 110 |
; A longer phrase needing definition |
| 111 |
: Phrase defined |
| 112 |
; A word : Which has a definition |
| 113 |
: Also a second definition |
| 114 |
: And even a third |
| 115 |
|
| 116 |
Begin with a semicolon. One item per line; a newline can appear before the colon, but using a space before the colon improves parsing. |
| 117 |
|
| 118 |
---- |
| 119 |
|
| 120 |
* You can even do mixed lists |
| 121 |
*# and nest them |
| 122 |
*# inside each other |
| 123 |
*#* or break lines<br>in lists. |
| 124 |
*#; definition lists |
| 125 |
*#: can be |
| 126 |
*#:; nested : too |
| 127 |
|
| 128 |
---- |
| 129 |
|
| 130 |
: A colon (:) indents a line or paragraph. |
| 131 |
A newline starts a new paragraph. |
| 132 |
Should only be used on talk pages. |
| 133 |
For articles, you probably want the blockquote tag. |
| 134 |
: We use 1 colon to indent once. |
| 135 |
:: We use 2 colons to indent twice. |
| 136 |
::: 3 colons to indent 3 times, and so on. |
| 137 |
|
| 138 |
---- |
| 139 |
|
| 140 |
You can make ''horizontal dividing lines'' (----) to separate text. |
| 141 |
---- |
| 142 |
But you should usually use sections instead, so that they go in the table of contents. |
| 143 |
|
| 144 |
---- |
| 145 |
|
| 146 |
You can add footnotes to sentences using the ''ref'' tag -- this is especially good for citing a source. |
| 147 |
|
| 148 |
:There are over six billion people in the world.<ref>CIA World Factbook, 2006.</ref> |
| 149 |
|
| 150 |
References: <references/> |
| 151 |
|
| 152 |
For details, see [[Wikipedia:Footnotes]] and [[Help:Footnotes]]. |
| 153 |
|
| 154 |
|
| 155 |
== Links == |
| 156 |
|
| 157 |
Here's a link to a page named [[Official positions|Official position]]. You can even say [[official positions]] and the link will show up correctly. |
| 158 |
|
| 159 |
---- |
| 160 |
|
| 161 |
You can put formatting around a link. Example: ''[[Wikipedia]]''. |
| 162 |
|
| 163 |
---- |
| 164 |
|
| 165 |
The ''first letter'' of articles is automatically capitalized, so [[wikipedia]] goes to the same place as [[Wikipedia]]. Capitalization matters after the first letter. |
| 166 |
|
| 167 |
---- |
| 168 |
|
| 169 |
[[Intentionally permanent red link]] is a page that doesn't exist yet. You could create it by clicking on the link. |
| 170 |
|
| 171 |
---- |
| 172 |
|
| 173 |
You can link to a page section by its title: |
| 174 |
|
| 175 |
* [[Doxygen#Doxygen Examples]]. |
| 176 |
|
| 177 |
If multiple sections have the same title, add a number. [[#Example section 3]] goes to the third section named "Example section". |
| 178 |
|
| 179 |
---- |
| 180 |
|
| 181 |
You can make a link point to a different place with a [[Help:Piped link|piped link]]. Put the link |
| 182 |
target first, then the pipe character "|", then the link text. |
| 183 |
|
| 184 |
* [[Help:Link|About Links]] |
| 185 |
* [[List of cities by country#Morocco|Cities in Morocco]] |
| 186 |
|
| 187 |
Or you can use the "pipe trick" so that a title that contains disambiguation text will appear with more concise link text. |
| 188 |
|
| 189 |
* [[Spinning (textiles)|]] |
| 190 |
* [[Boston, Massachusetts|]] |
| 191 |
|
| 192 |
---- |
| 193 |
|
| 194 |
You can make an external link just by typing a URL: http://www.nupedia.com |
| 195 |
|
| 196 |
You can give it a title: [http://www.nupedia.com Nupedia] |
| 197 |
|
| 198 |
Or leave the title blank: [http://www.nupedia.com] |
| 199 |
|
| 200 |
External link can be used to link to a wiki page that cannot be linked to with <nowiki>[[page]]</nowiki>: http://meta.wikimedia.org/w/index.php?title=Fotonotes&oldid=482030#Installation |
| 201 |
|
| 202 |
---- |
| 203 |
|
| 204 |
Linking to an e-mail address works the same way: mailto:[email protected] or [mailto:[email protected] someone] |
| 205 |
|
| 206 |
---- |
| 207 |
|
| 208 |
#REDIRECT [[Official positions|Official position]] |
| 209 |
|
| 210 |
---- |
| 211 |
|
| 212 |
[[Help:Category|Category links]] do not show up in line but instead at page bottom ''and cause the page to be listed in the category.'' |
| 213 |
[[Category:English documentation]] |
| 214 |
|
| 215 |
Add an extra colon to ''link'' to a category in line without causing the page to be listed in the category: |
| 216 |
[[:Category:English documentation]] |
| 217 |
|
| 218 |
---- |
| 219 |
|
| 220 |
The Wiki reformats linked dates to match the reader's date preferences. These three dates will show up the |
| 221 |
same if you choose a format in your [[Special:Preferences|]]: |
| 222 |
* [[1969-07-20]] |
| 223 |
* [[July 20]], [[1969]] |
| 224 |
* [[20 July]] [[1969]] |
| 225 |
|
| 226 |
|
| 227 |
== Just show what I typed == |
| 228 |
|
| 229 |
<nowiki> |
| 230 |
The nowiki tag ignores |
| 231 |
[[Wiki]] ''markup''. |
| 232 |
It reformats text by |
| 233 |
removing |
| 234 |
newlines and multiple |
| 235 |
spaces. |
| 236 |
It still interprets special |
| 237 |
characters: → |
| 238 |
</nowiki> |
| 239 |
|
| 240 |
---- |
| 241 |
|
| 242 |
<pre> |
| 243 |
The pre tag ignores [[Wiki]] |
| 244 |
''markup''. |
| 245 |
It also doesn't reformat |
| 246 |
text. |
| 247 |
It still interprets special |
| 248 |
characters: → |
| 249 |
</pre> |
| 250 |
|
| 251 |
---- |
| 252 |
|
| 253 |
Leading spaces are another way |
| 254 |
to preserve formatting. |
| 255 |
|
| 256 |
Putting a space at the |
| 257 |
beginning of each |
| 258 |
line stops the text |
| 259 |
from being |
| 260 |
reformatted. It still |
| 261 |
interprets [[Wiki]] |
| 262 |
''markup'' and special |
| 263 |
characters: → |
| 264 |
|
| 265 |
=== Source code === |
| 266 |
|
| 267 |
<source lang="csharp"> |
| 268 |
// Hello World in Microsoft C# ("C-Sharp"). |
| 269 |
|
| 270 |
using System; |
| 271 |
|
| 272 |
class HelloWorld |
| 273 |
{ |
| 274 |
public static int Main(String[] args) |
| 275 |
{ |
| 276 |
Console.WriteLine("Hello, World!"); |
| 277 |
return 0; |
| 278 |
} |
| 279 |
} |
| 280 |
</source> |
| 281 |
|
| 282 |
|
| 283 |
== Images, tables, video, and sounds == |
| 284 |
|
| 285 |
A picture, including alternate text: |
| 286 |
|
| 287 |
[[Image:Wiki.png|This is Wiki's logo]] |
| 288 |
|
| 289 |
You can put the image in a frame with a caption: [[Image:Wiki.png|frame|This is Wiki's logo]] |
| 290 |
|
| 291 |
---- |
| 292 |
|
| 293 |
A link to Wikipedia's page for the image: [[:Image:Wiki.png]] |
| 294 |
|
| 295 |
Or a link directly to the image itself: [[Media:Wiki.png]] |
| 296 |
|
| 297 |
---- |
| 298 |
|
| 299 |
Use '''media:''' links to link directly to sounds or videos: [[media:Classical guitar scale.ogg|A sound file]] |
| 300 |
|
| 301 |
---- |
| 302 |
|
| 303 |
Provide a spoken rendition of some text in a template: |
| 304 |
{{listen |
| 305 |
|title = Flow, my tears |
| 306 |
|filename = Flow, my tears.ogg |
| 307 |
|filesize = 1.41 MB |
| 308 |
}} |
| 309 |
|
| 310 |
---- |
| 311 |
|
| 312 |
<span style="border:5px double black">'''Text In a Box'''</span> |
| 313 |
|
| 314 |
---- |
| 315 |
|
| 316 |
{| border="10" cellspacing="5" cellpadding="10" align="center" |
| 317 |
|- |
| 318 |
! This |
| 319 |
! is |
| 320 |
|- |
| 321 |
| a |
| 322 |
| table |
| 323 |
|} |
| 324 |
|
| 325 |
=== Galleries === |
| 326 |
|
| 327 |
<gallery> |
| 328 |
Image:Wiki.png |
| 329 |
Image:Wiki.png|Captioned |
| 330 |
Image:Wiki.png |
| 331 |
Image:Wiki.png|[[Wikipedia|Links]] can be put in captions. |
| 332 |
</gallery> |
| 333 |
|
| 334 |
|
| 335 |
== Mathematical formulae == |
| 336 |
|
| 337 |
<math>\sum_{n=0}^\infty \frac{x^n}{n!}</math> |
| 338 |
|
| 339 |
|
| 340 |
== Templates == |
| 341 |
|
| 342 |
{{Transclusion demo}} |
| 343 |
|
| 344 |
---- |
| 345 |
|
| 346 |
{{Help:Transclusion Demo}} |
| 347 |
|
| 348 |
---- |
| 349 |
|
| 350 |
This template takes two parameters, and creates underlined text with a hover box for many modern browsers supporting CSS: |
| 351 |
|
| 352 |
{{H:title|This is the hover text|Hover your mouse over this text}} |
| 353 |
|
| 354 |
Go to this page to see the H:title template itself: {{tl|H:title}} |
| 355 |
|