Cheat sheet for MediaWiki: Difference between revisions

From Leechfinger
Jump to navigationJump to search
Qais (talk | contribs)
No edit summary
Qais (talk | contribs)
 
(34 intermediate revisions by the same user not shown)
Line 5: Line 5:
Below is a table of the most commonly used wikitext formatting, the middle column is what you type into the article in "edit mode" (after clicking the edit link at the top of the page), and the right-hand column shows what the result would be when viewing the article normally.  
Below is a table of the most commonly used wikitext formatting, the middle column is what you type into the article in "edit mode" (after clicking the edit link at the top of the page), and the right-hand column shows what the result would be when viewing the article normally.  


{| style="border:none; text-align:left;  background:#f0f0f0; font-size: 95%;"
 
{| class="wikitable" style="border:none; text-align:left;  background:#f0f0f0; font-size: 95%;"
|-
|-
| width="25%" style="background: #e4e4e4; padding: 3px 5px; text-align:center;"|'''Description'''
| width="25%" style="background: #e4e4e4; padding: 3px 5px; text-align:center;"|'''Description'''
Line 117: Line 118:
<nowiki>without ''markup''</nowiki>
<nowiki>without ''markup''</nowiki>
|-
|-
|colspan="3" style="border-top:1px solid #d4d4d4;"|&nbsp;
|-
|valign="top"|Syntax Highlight with <br/>line numbering
|
<nowiki><syntaxhighlight lang="bash" line></nowiki><br  />
<code>#!/bin/bash</code><br/>
<code># my bash script</code><br/>
<nowiki></syntaxhighlight></nowiki>
|<syntaxhighlight lang="bash" line>#!/bin/bash
# my bash script
</syntaxhighlight>
|-
|colspan="3" style="border-top:1px solid #d4d4d4;"|&nbsp;
|-
|valign="top"| Horizontal rule
|
Text Before <br/>
<nowiki> ---- </nowiki><br/>
Text After
| Text Before <br>
----
Text After
|-
| colspan="3" style="background: #e4e4e4; padding: 3px 5px; font-family: sans-serif; font-size: 0.9em; text-align:center;" | Applies only at the beginning of the line
| colspan="3" style="background: #e4e4e4; padding: 3px 5px; font-family: sans-serif; font-size: 0.9em; text-align:center;" | Applies only at the beginning of the line
|-
|-
Line 185: Line 215:
[[File:Example.jpg|thumb|Caption text]]
[[File:Example.jpg|thumb|Caption text]]
|}
|}
== Main page ==
  * MediaWiki:Mainpage
== New lines ==
To create new lines between two paragraphs you will need to insert two blank lines or use <nowiki> <br /> </nowiki>.
If you put a space in the beginning of the paragraph it will be treated as <nowiki><pre></nowiki> in HTML.


 
== Trasclusion ==
You can insert on page into another. This is done if the pages are too long and you want to break them up. You can insert a second written page into the first one by<br/>
<nowiki> {{:History of sock hangers}}</nowiki>
== Comments ==
Comments is text you don't want to to show but need it for information. Comments can be added to your MediaWiki by <nowiki><!-- insert comment here --></nowiki>.<br/>
You can also use <nowiki> <noinclude> Your comment </noinclude> </nowiki> for your comments.
== Side Menu ==
The side menu is nothing but an article and cal be called by MediaWiki:Sidebar.
== Artile ==
; Part of the article
: Use <nowiki><onlyinclude> your text </onlyinclude></nowiki>
== Magic Words ==
Magic words are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page explains only the standard magic words. 
[https://www.mediawiki.org/wiki/Help:Magic%20words All Magic words]
== Site Nice ==
  * MediaWiki:Sitenotice
== Change logo ==
  * /resources/assets/change-your-logo.svg"
== Special Pages ==
  * Special:SpecialPages
== Change Theme ==
Edit LocalSettings.php and change the value of $wgDefaultSkin.
<syntaxhighlight lang="php" line>
## Default skin: you can change the default skin. Use the internal symbolic
## names, e.g. 'vector' or 'monobook':
$wgDefaultSkin = "vector";
       
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MinervaNeue' );
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
</syntaxhighlight>
[[Category:Mediawiki]]
[[Category:Mediawiki]]

Latest revision as of 13:22, 14 June 2024

Basics editing

Wikis use symbols such as asterisks, single-quotes, square-brackets and braces to represent formatting elements like making words into links to other sites or articles, or creating tables for layout and dividing the text into headings. This kind of text markup used in the MediaWiki (Wikipedia) project is called wikitext.

Below is a table of the most commonly used wikitext formatting, the middle column is what you type into the article in "edit mode" (after clicking the edit link at the top of the page), and the right-hand column shows what the result would be when viewing the article normally.


Description You type You get
Applies anywhere
Italicise text

''italic''

italic

 
Bold text

'''bold'''

bold

 
Bold and italic

'''''bold & italic'''''

bold & italic

 
Internal link

(within this wiki)

Internal link
(to a category)

Interwiki Link
(to partner wiki)

[[name of page]]
[[name of page|display text]]

[[:Category:name of category]]


[[w:name of article]]
[[wiki:name of article]]
[[wiki:name of article|display text]]

name of page
display text

Category:name of category


w:name of article
wiki:name of article
display text


Note: red links mean
the page doesn't exist yet

 
External link

(to other websites)

[http://www.example.com]
[http://www.example.com display text]
http://www.example.com
[mailto:[email protected] Jane's email]

[1]
display text
http://www.example.com
Janes's email

 
Redirect

#redirect [[Target page]]

1. redirect Target page

 
Signature

~~~
~~~~
~~~~~

J.Doe
J.Doe 16:18, 19 May 2025
16:18, 19 May 2025

 
Escape wiki markup

with ''markup''
<nowiki>without ''markup''</nowiki>

with markup
without ''markup''

 
Syntax Highlight with
line numbering

<syntaxhighlight lang="bash" line>
#!/bin/bash
# my bash script
</syntaxhighlight>

#!/bin/bash
# my bash script
 
Horizontal rule

Text Before
----
Text After

Text Before

Text After

Applies only at the beginning of the line
Headings

of different sizes

== level 1 ==
=== level 2 ===
==== level 3 ====
===== level 4 =====

Tip: put __NOTOC__ in an article
to remove its table-of-contents

Level 1

Level 2

Level 3

Level 4
 
Outline Numbered
Headings

# one
# two
## two point one
# three

1. one

2. two

2.1 two point one

3. three

 
Bullet list

* one
* two
** two point one
* three

  • one
  • two
    • two point one
  • three
 
Definition list

;Definition
:item 1
:item 2

Definition
item 1
item 2
 
Thumbnail image

[[File:Example.jpg|thumb|Caption text]]

Caption text

Main page

 * MediaWiki:Mainpage

New lines

To create new lines between two paragraphs you will need to insert two blank lines or use <br /> . If you put a space in the beginning of the paragraph it will be treated as <pre> in HTML.

Trasclusion

You can insert on page into another. This is done if the pages are too long and you want to break them up. You can insert a second written page into the first one by
{{:History of sock hangers}}

Comments

Comments is text you don't want to to show but need it for information. Comments can be added to your MediaWiki by <!-- insert comment here -->.
You can also use <noinclude> Your comment </noinclude> for your comments.

Side Menu

The side menu is nothing but an article and cal be called by MediaWiki:Sidebar.

Artile

Part of the article
Use <onlyinclude> your text </onlyinclude>

Magic Words

Magic words are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page explains only the standard magic words. All Magic words

Site Nice

 * MediaWiki:Sitenotice

 * /resources/assets/change-your-logo.svg"

Special Pages

 * Special:SpecialPages

Change Theme

Edit LocalSettings.php and change the value of $wgDefaultSkin.

## Default skin: you can change the default skin. Use the internal symbolic
## names, e.g. 'vector' or 'monobook':
$wgDefaultSkin = "vector"; 
        
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MinervaNeue' );
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );