Help:Wikitext examples/cs
<languages/> Template:PD Help Page
Formatting text in wikitext
{{#section:Template:TNTN|formatting}}
Organizing your writing
Template:See also{{#section:Template:TNTN|lists}}
Creating links
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: →
</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
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:
- Template:Ll - for file uploads and image syntax.
- Template:Ll - 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: This is Wiki's logo 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: 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): | 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 Template:Tag tag, like this:
-
Captioned
-
Links can be put in captions.
Mathematical formula
To format mathematical formula, you can useTeX markup.
| Rendering | Wikitext |
|---|---|
<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}}
| |
|
This template uses takes one parameter and returns it twice: |
This template uses takes one parameter and returns it twice:
{{2x|Hello World}}
|
See also
[[Category:Help{{#translation:}}]]