Help:Wikitext examples
<languages/> Template:PD Help Page <translate>
Formatting text in wikitext
</translate> {{#section:Template:TNTN|formatting}}
<translate>
Organizing your writing
</translate> Template:See also{{#section:Template:TNTN|lists}}
<translate>
Creating links
</translate> Template:Main <translate> You will often want to make clickable links to other pages. </translate> {{#section:Template:TNTN|linkstable}}
<translate>
Displaying text as typed
A few different formatting methods will ensure the Wiki shows your text exactly as you type it. </translate>
| <translate> Rendering</translate> | <translate> Wikitext</translate> |
|---|---|
|
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: →
|
<translate>
Displaying code
</translate> Template:Main <translate> If the syntax highlighting extension is available, you can show source code similarly to the HTML <tvar name=1>Template:Tag</tvar> tag, but with advanced text editor-like syntax highlighting.</translate> <translate> See the list of supported languages:</translate> http://pygments.org/languages/ <translate> Here's an example for displaying C# code:</translate>
<syntaxhighlight lang="csharp">
// <translate nowrap> Hello World in Microsoft C# ("C-Sharp").</translate>
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("<translate nowrap> Hello, World!</translate>");
return 0;
}
}
</syntaxhighlight>
Renders as:
// <translate nowrap><!--T:15--> Hello World in Microsoft C# ("C-Sharp").</translate>
using System;
class HelloWorld
{
public static int Main(String[] args)
{
Console.WriteLine("<translate nowrap><!--T:16--> Hello, World!</translate>");
return 0;
}
}
<translate>
Using images, tables, video, and sounds
For more detailed guides, see: </translate>
- Template:Ll - <translate> for file uploads and image syntax.</translate>
- Template:Ll - <translate> for creating tables.</translate>
<translate> Once you upload a file, enter its filename, highlight it, and click the "embedded image" button on the edit toolbar.</translate> <translate> This will generate the embedding syntax:</translate>
[[Image:filename.png]]
| <translate> Rendering</translate> | <translate> Wikitext</translate> | ||||
|---|---|---|---|---|---|
|
<translate> An image with alternate text:</translate> <translate> This is Wiki's logo</translate> <translate> Image with frame and caption:</translate> |
<translate nowrap><!--T:29--> An image with alternate text:</translate>
[[Image:Wiki.png|<translate nowrap><!--T:30--> This is Wiki's logo</translate>]]
<translate nowrap><!--T:31--> Image with frame and caption:</translate>
[[Image:Wiki.png|frame|<translate nowrap><!--T:32--> This is Wiki's logo</translate>]]
| ||||
|
<translate> Link to MediaWiki's image page:</translate> Image:Wiki.png <translate> Direct link to the image:</translate> Media:Wiki.png |
<translate nowrap><!--T:35--> Link to MediaWiki's image page:</translate>
[[:Image:Wiki.png]]
<translate nowrap><!--T:36--> Direct link to the image:</translate>
[[Media:Wiki.png]]
| ||||
|
<translate> The media: namespace tag can be used to link directly to sounds or videos:</translate> <translate> A sound file</translate> |
<translate nowrap><!--T:39--> The '''media:''' namespace tag can be used to link directly to sounds or videos:</translate>
[[media:Classical guitar scale.ogg|<translate nowrap><!--T:40--> A sound file</translate>]]
| ||||
| <translate> Include a spoken version of text in a template (<tvar name="1">Template:Tl</tvar>):</translate> | <translate nowrap>
<!--T:42-->
Include a spoken version of text in a template:
</translate>
{{listen
|title = Flow, my tears
|filename = Flow, my tears.ogg
|filesize = 1.41 MB
}}
| ||||
|<center><span style="border:5px double black">'''<translate nowrap><!--T:44--> Text in a bordered box</translate>'''</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
|}
|
<translate>
Galleries
</translate> Template:See also <translate> Images can be organized into galleries using the <tvar name=1>Template:Tag</tvar> tag, like this: </translate>
-
<translate> Captioned</translate>
-
<translate> Links can be put in captions.</translate>
<translate>
Mathematical formula
</translate> Template:Main
<translate> To format mathematical formula, you can useTeX markup.</translate>
| <translate> Rendering</translate> | <translate> Wikitext</translate> |
|---|---|
<math>\sum_{n=0}^\infty \frac{x^n}{n!}</math>
|
<translate>
Templates
</translate> Template:Main <translate> Templates are snippets of Wiki markup that can be automatically copied ("transcluded") into a page.</translate> <translate> You can add them by placing the template's name inside {{double braces}}.</translate> <translate> To transclude pages from other namespaces, use {{:colon and double braces}}.</translate> <translate> Some templates accept parameters, separated by the pipe character.</translate>
| <translate> Rendering</translate> | <translate> Wikitext</translate> |
|---|---|
{{Help:Wikitext examples/transclusion demo}}
| |
|
<translate> This template uses takes one parameter and returns it twice: </translate> Template:2x |
<translate nowrap>
<!--T:62-->
This template uses takes one parameter and returns it twice:
</translate>
{{2x|<translate nowrap><!--T:63--> Hello World</translate>}}
|
<translate>
See also
</translate>
[[Category:Help{{#translation:}}]]