Ajuda:Exemples de wikitext
| Nota: Quan modifiqueu aquesta pàgina, esteu acceptant que la vostra contribució es publiqui en el marc de CC0. Vegeu Pàgines d'ajuda de domini públic per a més informació. |
Formatant text dins wikitext
| Rendering | Wikitext |
|---|---|
| Emphasize (italics), strongly (bold), very strongly (bold italics).
(These are double and triple apostrophes, not double quotes.) Note: this can also be applied to links (e.g., Wikipedia). |
''Emphasize'', '''strongly''',
'''''very strongly'''''.
''[[Wikipedia]]''
|
The use of italic and bold fonts is beneficial in mathematical calculations where specific font styles are needed instead of emphasis.
(Most people disregard the fact that these two approaches differ in a way that is not particularly significant for graphical browsers.) However, it can have a significant impact on those who are blind. |
The use of <i>italic</i> and <b>bold</b> fonts is beneficial in mathematical calculations where specific font styles are needed instead of emphasis.
: <b>F</b> = <i>m</i><b>a</b>
|
| You can write in small caps | You can write <span style="font-variant:small-caps">in small caps</span>
|
The typewriter font that is occasionally used for technical terms and computer code.
|
The typewriter font that is occasionally used for <kbd>technical terms</kbd> and <code>computer code</code>.
|
| For captions, you can use small text. | For captions, you can use <small>small text</small>.
|
| Deleted material can be You can also denote
|
Deleted material can be <s>struck out</s> and new material can be <u>underlined</u>.
You can also denote <del>deleted material</del> and <ins>inserted material</ins> with the respective tags, preserving their semantic meaning, rather than relying solely on visual cues like strikethrough and underline.
|
| Subscript: m2 Superscript: m2 or m² Many browsers find it simpler to format lines containing the HTML entity ² (²) rather than using the 2 HTML tag for representing superscripted text. |
Subscript: m<sub>2</sub><br />
Superscript: m<sup>2</sup> or m²
ε<sub>0</sub> =
8.85 × 10<sup>−12</sup>
C² / J m.
<br /><br />
1 [[hectare]] = [[1 E4 m²]]
|
Organitzant la vostra escriptura
| Resultat | Text en sintaxi wiki |
|---|---|
Redacció de seccions i subseccionsComençar una secció amb una línia d'encapçalament
|
== Una secció ==
=== Una subsecció ===
==== Una altra subsubsecció ====
|
|
Això és una línia.
Això encara forma part del mateix paràgraf.
Això és un paràgraf.<p>Això és una continuació del paràgraf. Però apareix després d'una línia buida a causa de les etiquetes <p> i </p>.</p>
Això és una línia.<div>Aquesta és una altra línia que apareix com un segon paràgraf nou en comptes d'un tercer paràgraf a causa de les etiquetes <div> i </div>.</div>
|
|
Es poden trencar línies <br/> sense començar un altre paràgraf.
|
Una línia que comença sense un asterisc marca el final de la llista.
Now you are ready to create well-structured unordered lists. |
* Comenceu una línia amb asteriscs (<code>*</code>) per crear el primer element d'una llista no ordenada.
** Utilitzeu dos asteriscs per a un subelement.
*** Augmenteu el nombre d'asteriscs per a nivells més profunds.
* Cada salt de línia indica un element nou a la llista.
Una línia que comença sense estrella marca el final de la llista.
* Podeu començar de nou amb una llista nova.
Ara ja podeu crear llistes no ordenades ben estructurades.
|
Una línia que comença sense coixinet marca el final de la llista.
|
# Utilitzeu un coixinet (<code>#</code>) al principi de cada línia per indicar l'ordre.
## Utilitzeu dos coixinets (<code>##</code>) per a un subelement.
## Continueu numerant per mantenir la seqüència i el flux lògic d'informació.
# Afegiu una nova línia entre cada element per millorar la llegibilitat.
Una línia que comença sense coixinet marca el final de la llista.
# Una llista ordenada comença amb 1.
# Després 2, etc.
|
|
* Aquesta llista mixta comença amb una llista no ordenada (<code>*</code>).
*# Per crear un subelement d'una llista ordenada sota una llista no ordenada, utilitzeu un asterisc i un coixinet (<code>*#</code>).
*#* Per crear un subelement més profund d'una llista no ordenada dins d'una llista ordenada, afegiu un altre asterisc (<code>*#*</code>).
*#* També podeu trencar <br/> línies en una llista.
|
|
Una llista de definicions consisteix en una sèrie de parells terme-definició.
Significar un element per línia és el més adequat, en lloc d'afegir una nova línia abans dels dos punts ( |
; Wiki
: Una wiki és una forma de publicació d'hipertext en línia que s'edita i gestiona de manera col·laborativa pel seu propi públic directament a través d'un navegador web. Vegeu [[:ca:Wiki|Wiki]].
; Navegador web
: Un navegador web és una aplicació per accedir a llocs web. Vegeu [[:ca:Navegador web|Navegador web]]
|
SagniaUn paràgraf té sagnia quan s'especifica dos punts (
Això s'utilitza sovint com a solució alternativa per sagnar la línia, però perjudicarà l'accessibilitat i produirà una sortida HTML no vàlida. L'ús de CSS per al sagnat visual és un enfocament molt més preferible (per exemple, {{Indent}}).
|
: Una línia amb sagnia.
Una nova línia inicia un nou paràgraf sense sagnia.
|
Una cita en blocUn estil de cita en bloc s'utilitza per ressaltar una secció específica de text d'una font externa o per distingir-la del contingut circumdant.
|
<blockquote>
Això és una cita en bloc. S'utilitza per ressaltar text citat o separar contingut específic.
</blockquote>
|
Línia divisòria horitzontalLa línia divisòria horitzontal d'una pàgina wiki es representa per quatre o més guions consecutius (
|
Text a sobre de la línia divisòria
----
Text a sota de la línia divisòria
|
Creant enllaços
You will often want to make clickable links to other pages.
| Renderització | Wikitext |
|---|---|
Ús bàsicEsteu llegint la documentation. |
Esteu llegint la [[documentation]].
|
Ús bàsic + Format de textEls enllaços es poden posar en "cursiva", p. ex.: |
''[[MediaWiki]]''
|
Enllaços interwikiAquests enllacen a un altre wiki que tracta temes relacionats o similars.
|
This interwiki link points to [[w:Documentation]] on Wikipedia.
Its Esperanto word equivalent is [[:eo:Dokumentaro]].
|
Links to sectionsYou can link to a specific section of an existing page by adding a pound ( If no such section exists then the link points to the beginning of the page. If a page has multiple sections with the same name, specifying the rank of the section with a number at the end. (e.g., if there are three sections titled "Section title" and you want to link to the third, use [[#Section title 3]]). See Help:Editing FAQ. |
[[Help:Special pages#Editing Special namespace pages|Help:Special pages]]
|
|
Create a link label using a pipe symbol ( The above produces About links, linked to the article Help:Link. |
* [[Help:Link|About links]]
|
Blank link labelUsing a blank link label will automatically fill in an appropriate link label. I.e. |
* Parentheses: [[kingdom (biology)|]].
* Colon: [[Help:Pipe|]].
|
Links to pages that don't exist
To create the page, you can click on the link. See Ajuda:Inici d'una nova pàgina (and the naming conventions of your project, if there are). |
A link to a page which does not exist (like [[Foo|this one]]) is colored in red.
|
RedirectsYou can create a redirect by adding the wikitext at the beginning of the page. See Ajuda:Redireccions. #REDIRECT [[United States of America]]
|
#REDIRECT [[United States of America]]
|
Magic linksMagic links enable users to generate links automatically by typing specific keywords.
These are deprecated and generally should not be used. |
* ISBN 0131103629 * RFC 234 |
|
[[media:Test.ogg|Audio]]
|
Category linksCategory links direct users to a specific category page (without categorizing the page into that category). To achieve this, a syntax similar to that of links is used, but with a colon ( |
[[:Category:Documentation]] |
Special pagesSpecial pages are created by the wiki software. They are accessed through the Special namespace. You can create links to special pages like "What links here" using the following format: See Ajuda:Pàgines especials for other special pages. |
[[Special:Whatlinkshere/Help:Editing]] |
Links to previous revisions of a page, differences (diffs), and particular history pagesTo link to an old revision, diff, or particular history pages, avoid using the standard wiki-link syntax like Linking to previous revisions of a pageTo share an old page version of a wiki, copy the URL from the page's history and paste it where you want to share it.
You can also use Special:PermaLink to do this, i.e Special:PermaLink/6364084 Linking to diffs:To link to page differences between two revisions, copy and paste the specific URL of the page containing the diff of the compared pages.
You can also use Special:Diff to do this, i.e Special:Diff/6364333/6364084 Linking to a specific page from edit historyNavigate to the edit history and select the |
https://www.mediawiki.org/w/index.php?title=Help:Cite&oldid=6364084 https://www.mediawiki.org/w/index.php?title=Help%3ACite&diff=6364333&oldid=6364084 https://www.mediawiki.org/w/index.php?title=Help:Cite&action=history&offset=20170210105218%7C2391706&limit=100 |
Displaying text as typed
A few different formatting methods will ensure the wiki shows your text exactly as you type it.
| Rendering | Wikitext |
|---|---|
| The nowiki tag prevents [[Wiki]] ''markup'' from rendering. It adjusts text by eliminating newlines and multiple spaces. It still processes special characters: → | <nowiki>
The nowiki tag prevents
[[Wiki]] ''markup'' from rendering.
It adjusts text by
eliminating
newlines and multiple
spaces.
It still processes special
characters: →
</nowiki>
|
The pre tag bypasses [[Wiki]] ''markup''. It also maintains text format. It still recognizes special characters: → |
<pre>
The pre tag bypasses [[Wiki]]
''markup''.
It also maintains text
format.
It still recognizes special
characters: →
</pre>
|
|
Leading spaces offer another method to keep formatting. Inserting a space at the start of each line keeps the text as is. It still processes Wiki markup and special characters: → |
Leading spaces offer another method to keep formatting.
Inserting a space at the
start of each
line keeps the text
as is. It still
processes [[Wiki]]
''markup'' and special
characters: →
|
Displaying code
If the syntax highlighting extension is available, you can show source code similarly to the HTML <pre> tag, but with advanced text editor-like syntax highlighting.
See the list of supported languages:
http://pygments.org/languages/
Here's an example for displaying C# code:
<syntaxhighlight lang="csharp">
// Hello World in Microsoft C# ("C-Sharp").
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("Hello, World!");
return 0;
}
}
</syntaxhighlight>
Renders as:
// Hello World in Microsoft C# ("C-Sharp").
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("Hello, World!");
return 0;
}
}
Using images, tables, video, and sounds
For more detailed guides, see:
- Ajuda:Imatges - for file uploads and image syntax.
- Ajuda:Taules - for creating tables.
Once you upload a file, enter its filename, highlight it, and click the "embedded image" button on the edit toolbar. This will generate the embedding syntax:
[[Image:filename.png]]
| Rendering | Wikitext | ||||
|---|---|---|---|---|---|
| An image with alternate text:
Image with frame and caption: |
An image with alternate text:
[[Image:Wiki.png|This is Wiki's logo]]
Image with frame and caption:
[[Image:Wiki.png|frame|This is Wiki's logo]]
| ||||
| Link to MediaWiki's image page:
Direct link to the image: Media:Wiki.png |
Link to MediaWiki's image page:
[[:Image:Wiki.png]]
Direct link to the image:
[[Media:Wiki.png]]
| ||||
| The media: namespace tag can be used to link directly to sounds or videos: | The '''media:''' namespace tag can be used to link directly to sounds or videos:
[[media:Classical guitar scale.ogg|A sound file]]
| ||||
| Include a spoken version of text in a template ({{Listen}}): | Include a spoken version of text in a template:
{{listen
|title = Flow, my tears
|filename = Flow, my tears.ogg
|filesize = 1.41 MB
}}
| ||||
|<center><span style="border:5px double black">'''Text in a bordered box'''</span></center>
|
| |||||
|
{| style="margin: auto; border: 10px solid black; border-spacing: 5px;"
|-
! style="padding: 10px;" | This
! style="padding: 10px;" | is
|-
| style="padding: 10px;" | a
| style="padding: 10px;" | table
|}
|
Galleries
Images can be organized into galleries using the <gallery> tag, like this:
-
Captioned
-
Links can be put in captions.
Mathematical formulae
To format mathematical formulae, you can use TeX markup.
| Rendering | Wikitext |
|---|---|
<math>\sum_{n=0}^\infty \frac{x^n}{n!}</math>
|
Templates
Templates are snippets of Wiki markup that can be automatically copied ("transcluded") into a page. You can add them by placing the template's name inside {{double braces}}. To transclude pages from other namespaces, use {{:colon and double braces}}. Some templates accept parameters, separated by the pipe character.
| Rendering | Wikitext |
|---|---|
|
This is a short demo text from the Wikitext examples/transclusion demo sub-page. |
{{Help:Wikitext examples/transclusion demo}}
|
| This template takes one parameter and returns it twice:
Hello WorldHello World |
This template takes one parameter and returns it twice:
{{2x|Hello World}}
|
