Help:Wikitext: Difference between revisions

Content deleted Content added
{{VE documentation}}
anchors should be at the start of the relevant content, not dropped randomly nearby; upright has never been described in this page, afaict, so link to somewhere that it's properly described
(12 intermediate revisions by 6 users not shown)
Line 8:
{{VE documentation}}
{{Wikitext navbox}}
The markup language called '''wikitext''', also known as '''wiki markup''' or '''wikicode''', consists of the syntax and keywords used by the [[MediaWiki]] software to format a page. (Note the lowercase spelling of these terms.) To learn how to see this [[hypertext markup]], and to save an edit, see [[Help:Editing]]. Generally, coding can be copied and pasted, without writing new code. There is a short list of markup and tips at [[Help:Cheatsheet]].
 
In addition to wikitext, some [[HTML element]]s are also allowed for presentation formatting. See [[Help:HTML in wikitext]] for information on this.
 
'''Wikitext''', also known as '''wiki markup''' or '''wikicode''', is the [[markup language]] used by the [[MediaWiki]] software to format pages. (Note the use of lowercase spelling for these terms.){{efn|Wikipedia is an encyclopedia that uses wikitext—wikitext is not named after Wikipedia.}}
 
To learn how to view and edit wikitext, and how to save changes, see [[Help:Editing]]. In most cases, markup can be copied and pasted without the need to write new code. A quick reference guide is available at [[Help:Cheatsheet]].
 
In addition to wikitext, some [[HTML elements]] are also permitted for presentation formatting. For more details, see [[Help:HTML in wikitext]].
{{TOC limit}}
 
==Layout==
Line 233 ⟶ 230:
}}
 
====<span class="anchor" id="DL"></span><span class="anchor" id="Definition lists"></span><span class="anchor" id="Association lists"></span><span class="anchor" id="H:DL"></span>Description lists====
===={{Anchor|DL}}Description lists====
{{anchors|Definition lists|Association lists|H:DL}}
{{Shortcut|H:DL}}
 
Line 904 ⟶ 900:
|}
 
====Create a pagenew link=page===
 
* To create a new page:
*# SaveEdit thatany page.
*# Create a link to it on some other (related) page.
*# Enter a [[help:Redlink|redlink]] wikilink: <nowiki>[</nowiki>[page name]].
*# Save that page.
*# Preview or save.
*# Click onActivate the link you just made. The new page will open for editing.
* For more information, see [[Wikipedia:Starting an article|starting an article]] and check out Wikipedia's [[Wikipedia:Naming conventions|naming conventions]].
* Please dolink notto create ayour new article without linking to it from at least one other article.
 
{| class="wikitable"
Line 926 ⟶ 923:
|}
 
===Create an alias for a page===
===Redirects===
{{main|Help:Redirect}}
 
* Create an alias for any page by creating a [[Wikipedia:Redirect|Redirect]] from one [[Help:Page name| page name]] to another.
* [[Wikipedia:Redirect|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 "[[US]]").
* First create a new page whose page name is the name of the alias. That is the redirect.
* 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.
* On the ''first'' line of the new redirect page, use the syntax shown in the table below. For example, [[US]] is a redirect.
* 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.
 
{| class="wikitable" border=1
Line 1,247 ⟶ 1,246:
* Embedding the image in the text is only possible for very small images.
* Embedding the image will affect the vertical formatting of text.
|- style="vertical-align: top;" id="alt tag"
| <syntaxhighlight lang="wikitext">With alternative text:
[[File:wiki.png|alt=Puzzle globe logo]]</syntaxhighlight>
Line 1,255 ⟶ 1,254:
 
|
* {{anchor|alt tag}}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 [[Wikipedia:Alternative text for images|Alternative text for images]] for help on choosing it.
 
|- style="vertical-align:top;"
Line 1,277 ⟶ 1,276:
* The frame tag automatically floats the image right.
* The frame tag is only of use with very small images or ones using the [[#px tag|px tag]]
* The attributes left, center or centre override this, and places the image to the left or the centre of the page. {{anchor|upright tag}}
* The last parameter is the caption that appears below the image.
 
Line 1,304 ⟶ 1,303:
* The [[WP:PIC|picture tutorial]] explains more options.
 
|- style="vertical-align:top;" id="px tag"
| <syntaxhighlight lang="wikitext">A picture resized to 50 pixels...
[[File:wiki.png|50 px|Wikipedia encyclopedia]]</syntaxhighlight>
Line 1,312 ⟶ 1,311:
 
|
* {{anchor|px tag}}The [[WP:PIC|picture tutorial]] explains more options.
* Sizing in pixels is deprecated and should be used very sparingly.
* There is an [[#upright tagWP:PICSIZE|''upright'' attributeparameter]] that should be used instead. These tags are optimised for both laptop and mobile phone screens.
 
|- style="vertical-align:top;"
Line 1,460 ⟶ 1,459:
 
If a page is transcluded without transclusion markup, it may cause an unintentional [[Help:Category#Putting_pages_in_categories|categorization]]. Any page transcluding it will contain the same category as the original page. Wrap the category markup with '''<nowiki><noinclude></nowiki>''' tags to prevent incorrect categorization.
 
{{anchor|hovertext}}
Some templates take ''parameters'', as well, which you separate with the pipe character <code>|</code>.
 
Line 1,476 ⟶ 1,475:
|
{{Help:Transclusion demo}}
|- id=hovertext
|-
|
<syntaxhighlight lang="wikitext">
Line 1,712 ⟶ 1,711:
|}
 
=={{<span class="anchor|" id="Limiting formatting}}"></span><span class="anchor" id="Limiting formatting / escaping wiki markup"></span> Limiting formatting and escaping wikitext ==
{{see also|Template:Escape template list}}
 
Several formatting methods in wikitext can force the wikitext to be displayed exactly as typed – essentially a "[[WYSIWYG|what you see is what you get]]" effect. These techniques are useful when you need to prevent wikitext from being interpreted by [[parser]], such as when showing examples of wikitext nested in a template.
A few different kinds of formatting will tell the wiki to display things as you typed them – what you see is what you get!
 
{| class="wikitable" style="margin-right:0em;"
Line 1,812:
|}
 
===<span class="anchor" id="NOWIKI"></span>Nowiki===
{{anchor|NOWIKI}}
{{redirect|WP:NOWIKI|the essay about the name "Wiki"|Wikipedia:Don't abbreviate "Wikipedia" as "Wiki"!|the Wikipedia language edition|Norwegian Wikipedia}}
{{shortcut|H:NOWIKI|WP:NOWIKI}}
Line 2,080 ⟶ 2,079:
|-
| <nowiki>{{CURRENTWEEK}}</nowiki> || {{CURRENTWEEK}}
|Number of weeks since January 1 (January 1 can be in week 1; but only if it's a Monday, Tues, Wed, Thurs - if it's Friday, Sat or Sun, Jan 1 will be in week 52 or 53){{cn|date=August 2025|}}
|
|-
| <nowiki>{{CURRENTDOW}}</nowiki> || {{CURRENTDOW}}
|
Monday0 =Sunday, 1 = Monday, Tuesday2 = 2Tuesday, etc.,.. but Sunday6 = 0Saturday
 
|-
Line 2,092 ⟶ 2,091:
| <nowiki>{{CURRENTMONTHNAME}}</nowiki>
| {{CURRENTMONTHNAME}}
|The nominative (subject) form, as usually seen in English
|
|-
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki>
| {{CURRENTMONTHNAMEGEN}}
'''{{tlf|CURRENTMONTHNAMEGEN}}''' is theThe genitive (possessive) grammatical form of the month name, as used in some languages but not in English; '''{{tlf|CURRENTMONTHNAME}}''' is the nominative (subject) form, as usually seen in English.
|
|-
| <nowiki>{{CURRENTDAY}}</nowiki> || {{CURRENTDAY}}
Line 2,112 ⟶ 2,111:
| <nowiki>{{NUMBEROFARTICLES}}</nowiki>
| {{NUMBEROFARTICLES}}
'''{{tlf|NUMBEROFARTICLES}}''' is the numberNumber of pages in the main namespace that contain a link and are not a redirect. This includes full articles, stubs containing a link, and disambiguation pages.
|
|-
| <nowiki>{{NUMBEROFPAGES}}</nowiki>
Line 2,161 ⟶ 2,160:
|
|}
In languages where it makes a difference, you can use constructs like <syntaxhighlight lang="wikitext" inline>{{grammar:case|word}}</syntaxhighlight> to convert a word from the nominative case to some other case. For example, <syntaxhighlight lang="wikitext" inline>{{grammar:genitive|{{CURRENTMONTHNAME}}}}</syntaxhighlight> means the same as <syntaxhighlight lang="wikitext" inline>{{CURRENTMONTHNAMEGEN}}</syntaxhighlight>. <!-- Is there a reference for this, other than the source code (for example, phase3/languages/Lnaguage*.php) ? -->
 
'''{{tlf|NUMBEROFARTICLES}}''' is the number of pages in the main namespace that contain a link and are not a redirect. This includes full articles, stubs containing a link, and disambiguation pages.
 
'''{{tlf|CURRENTMONTHNAMEGEN}}''' is the genitive (possessive) grammatical form of the month name, as used in some languages but not in English; '''{{tlf|CURRENTMONTHNAME}}''' is the nominative (subject) form, as usually seen in English.
 
In languages where it makes a difference, you can use constructs like <syntaxhighlight lang="wikitext" inline>{{grammar:case|word}}</syntaxhighlight> to convert a word from the nominative case to some other case. For example, <syntaxhighlight lang="wikitext" inline>{{grammar:genitive|{{CURRENTMONTHNAME}}}}</syntaxhighlight> means the same as <syntaxhighlight lang="wikitext" inline>{{CURRENTMONTHNAMEGEN}}</syntaxhighlight>. <!-- Is there a reference for this, other than the source code (for example, phase3/languages/Lnaguage*.php) ? -->
 
==HTML==