Essential MediaWiki Syntax You Need to Know: Difference between revisions

From Qiki
Jump to navigation Jump to search
Created page with "<span id="basic-text-formatting"></span> === 1. Basic Text Formatting === This is the foundation for making your text stand out. {| class="wikitable" |- ! style="text-align: left;"| Feature ! style="text-align: left;"| Syntax ! style="text-align: left;"| Example Input ! style="text-align: left;"| Example Output |- | style="text-align: left;"| '''Italic Text''' | style="text-align: left;"| Two apostrophes | style="text-align: left;"| <code>''This text is italic.''</code..."
 
 
Line 192: Line 192:
'''Output:'''
'''Output:'''


&lt;table class=“wikitable”&gt; &lt;caption&gt;Monthly Sales Report&lt;/caption&gt; &lt;tbody&gt;&lt;tr&gt; &lt;th&gt; Month &lt;/th&gt; &lt;th&gt; Sales &lt;/th&gt; &lt;th&gt; Goal &lt;/th&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; January &lt;/td&gt; &lt;td&gt; $10,000 &lt;/td&gt; &lt;td&gt; $9,000 &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt; February &lt;/td&gt; &lt;td&gt; $12,500 &lt;/td&gt; &lt;td&gt; $11,000 &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
{| class="wikitable"
 
|+ Monthly Sales Report
 
|-
! Month
! Sales
! Goal
|-
| January
| $10,000
| $9,000
|-
| February
| $12,500
| $11,000
|}
-----
-----


<span id="essential-magic-words-and-special-syntax"></span>
<span id="essential-magic-words-and-special-syntax"></span>
=== 7. Essential “Magic Words” and Special Syntax ===
=== 7. Essential “Magic Words” and Special Syntax ===



Latest revision as of 08:30, 4 September 2025

1. Basic Text Formatting

This is the foundation for making your text stand out.

Feature Syntax Example Input Example Output
Italic Text Two apostrophes This text is italic. This text is italic.
Bold Text Three apostrophes This text is bold. This text is bold.
Bold & Italic Five apostrophes This text is both. This text is both.
Inline Code <code> tags Use the <code>git commit</code> command. Use the git commit command.
Strikethrough <s> tags <s>This is no longer valid.</s> <s>This is no longer valid.</s>



2. Headings and Sections

Headings structure your document and automatically create a Table of Contents (TOC). The page title is Level 1, so you should always start your own headings at Level 2.

Level Syntax Example Output
Level 2 == Section Heading == <h2>Section Heading</h2>
Level 3 === Subsection Heading === <h3>Subsection Heading</h3>
Level 4 ==== Sub-subsection ==== <h4>Sub-subsection</h4>

Note: A Table of Contents is automatically generated once you have 4 or more headings.



3. Lists

Unordered (Bulleted) Lists

Use an asterisk (*) at the beginning of each line. Use more asterisks for sub-levels.

Syntax:

* First item
* Second item
** Sub-item 2.1
** Sub-item 2.2
* Third item

Output:

  • First item
  • Second item
    • Sub-item 2.1
    • Sub-item 2.2
  • Third item

Ordered (Numbered) Lists

Use a hash symbol (#) at the beginning of each line.

Syntax:

# First step
# Second step
## Sub-step 2.1
# Third step

Output:

  1. First step
  2. Second step
    1. Sub-step 2.1
  3. Third step



Links are the core of any wiki.

  • Bare URL: Just paste the URL.
  • Numbered Link: Enclose the URL in single square brackets.
    • Syntax: [1] displays as a numbered link like [1].
  • Named Link: Enclose the URL and the display text (separated by a space) in single square brackets.



5. Images

To display an image that has been uploaded to the wiki, you use a syntax similar to an internal link.

Basic Syntax: File:ImageName.jpg

Most Common Usage (with options):

File:MyPhoto.png
This is a caption for the image.
  • File:MyPhoto.png: The name of the image file.
  • thumb: Displays the image as a thumbnail in a frame.
  • right: Aligns the image to the right side of the page (left, center are also options).
  • 200px: Sets the maximum width of the image to 200 pixels.
  • This is a caption...: The text that appears below the image. All options are separated by pipes (|).



6. Tables

Tables can seem complex, but the basic syntax is straightforward.

  • {| starts the table.
  • |+ defines the table’s caption.
  • |- starts a new row.
  • ! starts a header cell.
  • | starts a normal cell.
  • } ends the table.

Syntax:

{| class="wikitable"
|+ Monthly Sales Report
|-
! Month
! Sales
! Goal
|-
| January
| $10,000
| $9,000
|-
| February
| $12,500
| $11,000
|}

Tip: class="wikitable" is a common and easy way to apply standard, clean formatting to your table.

Output:

Monthly Sales Report
Month Sales Goal
January $10,000 $9,000
February $12,500 $11,000

7. Essential “Magic Words” and Special Syntax

  • Signature: Ryan (talk) 08:27, 4 September 2025 (UTC)

    • On discussion or “talk” pages, typing four tildes will automatically insert your username and a timestamp when you save.
    • Ryan (talk) inserts just your username.
    • 08:27, 4 September 2025 (UTC) inserts just the timestamp.
  • Redirect: #REDIRECT Target Page Name

    • This must be the very first line of a page. It makes the current page automatically forward the user to the target page. Useful for handling synonyms or acronyms.
  • Categories:

    • Adds the page to a specific category, usually displayed at the very bottom of the page. This is crucial for organizing content.
  • Preventing Wiki Markup: <nowiki>

    • To show wikitext syntax without it being processed, enclose it in <nowiki> tags.
    • Example: <nowiki>This is not bold</nowiki> will display as This is not bold.
  • Footnotes/References: <ref> and <references />

    • Place a citation or note inside <ref> tags directly after the statement it supports.
    • Create a “References” section at the bottom of your article and place a single <references /> tag there. MediaWiki will automatically collect all your <ref> tags and list them in that spot.

    Syntax:

    The sky is blue.<ref>Source: "A Study of Atmospheres", page 12.</ref> The sun is bright.<ref>Source: "Facts about Stars", chapter 2.</ref>
    
    == References ==
    <references />

This covers about 95% of what you’ll need for everyday document writing on a MediaWiki site. A great tip is to find a well-formatted page on the wiki you’re using and click “Edit” or “View source” to see exactly how it was done.