Jump to content

Ajuda:Exemples de wikitext

From mediawiki.org
This page is a translated version of the page Help:Wikitext examples and the translation is 6% complete.

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.
F = ma

(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 struck out and new material can be underlined.

You can also denote deleted material and inserted material with the respective tags, preserving their semantic meaning, rather than relying solely on visual cues like strikethrough and underline.

  • Editing regular articles can be done directly without using special markup to indicate deletions or insertions.
  • Markup can be used to indicate deleted or inserted material when revising previous remarks on talk pages.
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 &sup2; (²) rather than using the 2 HTML tag for representing superscripted text.

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

1 hectare = 1 E4 m²

Subscript: m<sub>2</sub><br />
Superscript: m<sup>2</sup> or m&sup2;

&epsilon;<sub>0</sub> =
8.85 &times; 10<sup>&minus;12</sup>
C&sup2; / J m.
<br /><br />
1 [[hectare]] = [[1 E4 m&sup2;]]


Organitzant la vostra escriptura

See also: Help:Images
Resultat Text en sintaxi wiki

Redacció de seccions i subseccions

Començar una secció amb una línia d'encapçalament

Nota Nota:L'encapçalament de nivell superior, com el títol de la pàgina, s'indica amb un únic signe igual (=).

Una secció
Una subsecció
Una altra subsubsecció
  • Eviteu utilitzar encapçalaments de primer nivell (=); en comptes d'això, comenceu amb un encapçalament de segon nivell (==).
  • Eviteu saltar de nivell; per exemple, no aneu del segon al quart nivell.
  • Si un article té quatre o més parts, es generarà automàticament una taula de continguts (TOC).
  • Ordeneu les subseccions en l'ordre adequat. Quan enumereu països, per exemple, ordeneu-los alfabèticament en comptes de, per exemple, segons les seves respectives poblacions dins de l'ordre de l'OCDE o en qualsevol altre ordre aleatori.
  • Utilitzeu etiquetes d'encapçalament HTML i tanqueu els encapçalaments sense barres inclinades si voleu que no apareguin a la TOC. Per exemple:
    <h4>Subsecció amb un encapçalament de nivell massa baix per ser a la TOC<h4>
    
== Una secció ==

=== Una subsecció ===

==== Una altra subsubsecció ====
  • Afegir una línia nova no té cap efecte.

Això és una línia. Això encara forma part del mateix paràgraf.

  • Una línia buida comença un paràgraf nou o acaba una llista o una part amb sagnat. L'etiqueta ‎<p> pot desactivar un paràgraf fins a ‎</p> o el final de la secció.

Això és un paràgraf.

Això és una continuació del paràgraf. Però apareix després d'una línia buida a causa de les etiquetes ‎<p> i ‎</p>.

Això és una línia.

Aquesta és una altra línia que apareix com un segon paràgraf nou en lloc d'un tercer paràgraf a causa de les etiquetes ‎<div> i ‎</div>.

  • En una llista, s'utilitza una línia nova per separar elements i subelements individuals, millorant l'estructura visual i la llegibilitat del contingut de la llista en la sintaxi de MediaWiki. Vegeu List per a exemples.
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 &lt;p> i &lt;/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 &lt;div> i &lt;/div>.</div>

Es poden trencar línies
sense començar un altre paràgraf.

  • Si us plau, no feu servir això en excés.
  • No comenceu un enllaç , cursiva o negreta en una línia i l'acabeu a la següent; en comptes d'això, tanqueu el marcatge per línia.
Es poden trencar línies <br/> sense començar un altre paràgraf.
  • Comenceu una línia amb asteriscs (*) 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 un asterisc marca el final de la llista.

  • Podeu començar de nou amb una nova 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.
  1. Utilitzeu un coixinet (#) al principi de cada línia per indicar l'ordre.
    1. Utilitza dos coixinets (##) per a un subelement.
    2. Continueu numerant per mantenir la seqüència i el flux lògic d'informació.
  2. 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.

  1. Una llista ordenada comença amb 1.
  2. Després 2, etc.
# 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 (*).
    1. Per crear un subelement d'una llista ordenada sota una llista no ordenada, utilitzeu un asterisc i un coixinet (*#).
      • Per crear un subelement més profund d'una llista no ordenada dins d'una llista ordenada, afegiu un altre asterisc (*#*).
      • També podeu trencar
        línies en una llista.
* 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ó.

  • Utilitzeu un punt i coma (;) per indicar l'inici d'un terme.
  • Col·loqueu el terme immediatament després del punt i coma.
  • Utilitzeu dos punts (:) per introduir la definició associada al terme.
  • Col·loqueu la definició a la línia que segueix els 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 Wiki.
Navegador web
Un navegador web és una aplicació per accedir a llocs web. Vegeu Navegador web

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]]

Sagnia

Un paràgraf té sagnia quan s'especifica dos punts (:) al principi d'una línia, tal com s'explica a Llistes de definicions .

Una línia amb sagnia.

Una nova línia inicia un nou paràgraf sense sagnia.


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 bloc

Un 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.

Això és una cita en bloc. S'utilitza per ressaltar text citat o separar contingut específic.

<blockquote>
Això és una cita en bloc. S'utilitza per ressaltar text citat o separar contingut específic.
</blockquote>

Línia divisòria horitzontal

La línia divisòria horitzontal d'una pàgina wiki es representa per quatre o més guions consecutius (----), millorant l'organització visual entre seccions.

Text a sobre de la línia divisòria


Text a sota de la línia divisòria

Text a sobre de la línia divisòria
----
Text a sota de la línia divisòria


Creant enllaços

Main page: Help:Link

You will often want to make clickable links to other pages.

Renderització Wikitext

Ús bàsic

Esteu llegint la documentation.

Esteu llegint la [[documentation]].

Ús bàsic + Format de text

Els enllaços es poden posar en "cursiva", p. ex.:

MediaWiki

''[[MediaWiki]]''

Enllaços interwiki

Aquests 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.

This interwiki link points to [[w:Documentation]] on Wikipedia.

Its Esperanto word equivalent is [[:eo:Dokumentaro]].

You can link to a specific section of an existing page by adding a pound (#) and section title after specifying the page name.

Help:Special pages#Editing Special namespace pages

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]]

Using a blank link label will automatically fill in an appropriate link label. I.e. [[Kingdom (biology)|]] will be replaced with [[Kingdom (biology)|Kingdom]]

* Parentheses: [[kingdom (biology)|]].
* Colon: [[Help:Pipe|]].

A link to a page which does not exist (like this one) is colored in red.

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.

Redirects

You 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 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 links are used to reference a page containing media files. They are accessed through the Media namespace.

Audio

[[media:Test.ogg|Audio]]

Category 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 (:) added before the namespace.

Category:Documentation

[[:Category:Documentation]]

Special pages

Special 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:

Special:Whatlinkshere/Help:Editing

See Ajuda:Pàgines especials for other special pages.

[[Special:Whatlinkshere/Help:Editing]]

To link to an old revision, diff, or particular history pages, avoid using the standard wiki-link syntax like [[page]]. Instead, utilize the external link function or copy and paste the provided URLs directly.

Linking to previous revisions of a page

To 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.

https://www.mediawiki.org/w/index.php?title=Help:Cite&oldid=6364084

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.

https://www.mediawiki.org/w/index.php?title=Help%3ACite&diff=6364333&oldid=6364084

You can also use Special:Diff to do this, i.e Special:Diff/6364333/6364084

Linking to a specific page from edit history

Navigate to the edit history and select the XX anteriors or les més antigues buttons to reach a particular page history, then copy the URL and paste it where you want to share it.

https://www.mediawiki.org/w/index.php?title=Help:Cite&action=history&offset=20170210105218%7C2391706&limit=100

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: &rarr;
</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: &rarr;
</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: &rarr;

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:

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:

This is Wiki's logo

Image with frame and caption:

This is Wiki's logo
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:

Image:Wiki.png

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:

A sound file

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 }}):
Audio Flow, my tears (1.41 MB, help | download | file info)
Include a spoken version of text in a template:
{{listen
 |title    = Flow, my tears
 |filename = Flow, my tears.ogg
 |filesize = 1.41 MB
}}
Text in a bordered box
|<center><span style="border:5px double black">'''Text in a bordered box'''</span></center>
|
This is
a table
{| 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:

Mathematical formulae

To format mathematical formulae, you can use TeX markup.

Rendering Wikitext
n=0xnn!
<math>\sum_{n=0}^\infty \frac{x^n}{n!}</math>

Templates

Main page: Help:Template

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}}

See also