Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

Mediawiki markup


    1  Starting elements
       1.1  Article title
          1.1.1  Example
       1.2  Adding an alternate title
          1.2.1  Example
       1.3  Setting the article Meta
          1.3.1  Example
       1.4  Keeping the article name case
          1.4.1  Example
       1.5  Setting that the article is the index
       1.6  Setting that the article is a template
          1.6.1  Example
       1.7  Setting that the article is a redirect
    2  Syntax elements
       2.1  note
          2.1.1  Example
       2.2  br
          2.2.1  Example
       2.3  code
          2.3.1  Example
       2.4  pre
          2.4.1  Example
       2.5  source
          2.5.1  Example
       2.6  term
          2.6.1  Example
       2.7  Images
          2.7.1  Examples
       2.8  Resources
          2.8.1  Examples
       2.9  Article references
          2.9.1  Examples
       2.10  Including another article
          2.10.1  Example
       2.11  External links
          2.11.1  Examples
       2.12  Titles
          2.12.1  Example
       2.13  Lists
          2.13.1  Example
       2.14  More information
          2.14.1  Example
       2.15  li
       2.16  Infobox
          2.16.1  Example
       2.17  Tables
          2.17.1  Table header
          2.17.2  Table columns
          2.17.3  Table rows
          2.17.4  Table footer
          2.17.5  Example
    3  Ending elements
       3.1  Setting categories
          3.1.1  Example
       3.2  See Also
    4  Example
    5  Notes
    6  See also

This article explains the supported Mediawiki markup (See also Help:Formatting on Wikipedia).

Starting elements

Article title

By default, the title of the article will use the name of the file without the "md" extension. For example, the following file: myfile.md will create an article with the name MyFile.

However it is possible to specify the title of the article by using the following markup at the beginning of a line (and at the beginning of the file): {{name:<article name>}}

Example

      {{name:my article name}}

Adding an alternate title

It is possible to add an alternate title to the article by using the following markup at the beginning of a line: {{altTitle:<alternate title>}}

Example

      {{name:my article name}}
      {{altTitle:an other title}}
      {{altTitle:yet another title}}

Setting the article Meta

It is possible to set the the article meta: {{meta:the meta text}}

Example

      {{name:my article name}}
      {{meta:the text for the article}}

Keeping the article name case

It is possible to specify that the title of an article will keep its character case: {{lowercase}}

Example

      {{name:my article name}}
      {{lowercase}}

Setting that the article is the index

It is possible to set that the article is an index: {{index}}

      {{index}}

Setting that the article is a template

It is possible to set that the article is a template: {{template}}

Example

      {{name:my article name}}
      {{template}}

Setting that the article is a redirect

It is possible to set that the article is a redirect article: #REDIRECT [[redirected article ID]]

      {{name:my article name}}
      #REDIRECT [[redirected article ID]]

Syntax elements

note

A note will be added by the "<ref>" element.

Example

  the text<ref>with a note</ref>

br

A break will be added by the "<br/>" element, or by adding an empty line.

Example

  the first line
 <br/>
  the second line

  the third line after a break

code

A code will be added by the "<code>" element.

Example

      the first line with <code>code</code>

pre

A pre without syntax highlighting will be added by the "<pre>" element.

Example

  <pre>
  first line
  second line
  </pre>

source

A source with syntax highlighting will be added by the "<source>" element. It is identical to the pre element, except that:
  • the content will not begin on a new line
  • the "boxed" attribute is not supported
This element main usage is to add highlighted syntax inline (rather tha that "pre" element which will being a new line). As for the "pre" element, The possible values for the "lang" attribute are specified in the syntax highlighting article.

Example

  <source lang="xml">
  first line
  second line
  </source>

term

A term element adds a term and its definition (useful to define glossaries).

Example

  {{term:term1|the definition}}
  {{term:term2|the second definition}}

Images

An image will be added by the following construct[1]
The "image" tag is not case sensitive
: [[image:<image ID>|position|border|size]]

The attributes are separated by "|" characters:
  • position: "left", "center", or "right"
  • "border": present if the image should have a border
  • size: the width in pixels or in % of the page width


The last attribute, if not a size, allow to define the caption of the image.

Examples

      [[image:myImageID|right|border|40%]]
      [[Image:myImageID|50px]]
      [[Image:myImageID|50px|the caption]]

Resources

A resource File reference will be added by one of the following constructs[2]
The "resource" tag is not case sensitive
:
  • [[resource:<resource ID]]: for a resource identified by its ID
  • [[resource:<resource path]]: for a resource identified by its path
Paths declarations are separated by resource IDs because the path part has a file extension. See Resource files.

Examples

      [[file:myResourceID]]
      [[File:file.xml]]

Article references

An article reference will be added by the following construct: [[<ref ID>|<text>]]

Examples

      [[articleID|the reference text]]
      [[articleID]]

Including another article

Including the content of another article in an article is called transclusion on wikipedia. The syntax is:
  • {{:<article id>}: to include another article in the same package
  • {{<package id>:<article id>}: to include another article in another package

Example

      {{:articleID}}
External links are added by the following construct: [<link URL> <text>]

Examples

      [http://docs.oracle.com/javase/8/docs the reference text]
      [http://docs.oracle.com/javase/8/docs]

Titles

Titles can be defined by setting two or more "=" characters at the beginning of a line. The level of the title is specified by the number of "=" characters.

Example

      == my title ==

Lists

Lists can be defined by setting one or more "*" (for unordered lists) or "#" characters (for ordered lists) at the beginning of a line. The level of each list item is specified by the number of "*" or "#" characters.

Example

      * level 1 item
      ** level 2 item

More information

The See also element allows to add a "Main Article" link at the start of a paragraph. The syntax is:
  • {{See also:<article id>}: to add a "Main Article" link to another article in the same package
  • {{See also:<article id>|text}: to add a "Main Article" link to another article in the same package and set the description text

Example

      {{See also::<article id>}}

li

The "li" element defines a list item under an ordered or unordered list.

Infobox

infobox allows to add an infobox at the beginning of an article. The syntax is the same as in Wikipedia.

Example

      {{infobox infobox1
      | name = theName
      | prop1 = theProp1
      | prop2 = theProp2
      | prop3 = http://docs.oracle.com/javase/8/docs/api/index.html
      | prop4 = image1
      }}

Tables

Tables can be defined using the Mediawiki markup. Tables contain:
  • A header
  • The definition for the columns
  • The content of the table rows
  • A footer

Table header

The table header has the following markup:
      {| class="wikitable"
To define a table with sortable columns, you should specify:
      {| class="wikitable sortable"

Table columns

The table columns has the following markup:
      |-
      !Column 1
      !width=50|Column 2
      !width=50|colspan=2|Column 3
Each column begins with the "!" character. It can have the following attributes, separated by "|" characters:
  • "width": the width of the column
  • "colspan": the column span of the column

Table rows

Each row has the following markup:
      |-
      |cell 1||cell 2||cell 3
Each cell is separated by a "||" markup. The rowspan or colspan of the row can be specified using the following markup:
      |-
      |rowspan="2"|cell 1||cell 2||cell 3
      |-
      |colspan="3"|cell 1||cell 2||cell 3
The table footer has the following markup:
      |}

Example

      {| class="wikitable"
      |-
      !width=60| Column 1
      !width=110| Column 2
      |-
      |cell 1||cell 2||cell 3
      |-
      |cell 4||cell 5||cell 6
      |}

Ending elements

Setting categories

The categories on which belong the article can be set by the following construct: [[Category:<category name>]]

Example

      [[Category:<theCategory>]]
      [[Category:<theOtherCategory>]]

See Also

The "see" elements allows to add a See Also chapter at the end of the article with wiki links to other articles. They can be set by one of the following constructs:
  • {{See:<article ID>}}
  • {{See:<article ID>|<text>}}
  • {{See:<article ID>|<text>|<description>}}

Example

      {{name=article 1}}
      {{lowercase}}
      {{meta:the first article}}  

      This is the '''first article''' with an [http://docs.oracle.com/javase/8/docs/api/index.html external link] and an
      [[article 2|internal link]]  

      [[Category:general]]

Notes

  1. ^ The "image" tag is not case sensitive
  2. ^ The "resource" tag is not case sensitive

See also


Categories: mediawiki | syntax

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.