Help:Wikitext examples/en

From testwiki
Revision as of 13:38, 9 December 2024 by imported>FuzzyBot (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<languages/> Template:PD Help Page

Formatting text in wikitext

{{#section:Template:TNTN|formatting}}

Organizing your writing

Template:See also{{#section:Template:TNTN|lists}}

Template:Main You will often want to make clickable links to other pages. {{#section:Template:TNTN|linkstable}}

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

Template:Main If the syntax highlighting extension is available, you can show source code similarly to the HTML Template:Tag 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:

File:Wiki.png
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 (Template:Tl):

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

Template:See also Images can be organized into galleries using the Template:Tag tag, like this:

Mathematical formula

Template:Main

To format mathematical formula, you can useTeX markup.

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

Templates

Template:Main 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

Help:Wikitext examples/transclusion demo

{{Help:Wikitext examples/transclusion demo}}

This template uses takes one parameter and returns it twice: Template:2x

This template uses takes one parameter and returns it twice:
{{2x|Hello World}}

See also

[[Category:Help{{#translation:}}]]