= MoinWiki Syntax =

== Table Of Contents ==

'''Markup:''' 

{{{
<<TableOfContents>>
}}}

'''Results:'''

<<TableOfContents>>

== Headings ==

'''Markup:'''

{{{
=== heading 3rd level ===
==== heading 4th level ====
===== heading 5th level =====
====== heading 6th level ======
}}}

'''Results:'''

=== heading 3rd level ===
==== heading 4th level ====
===== heading 5th level =====
====== heading 6th level ======

== Text Formatting ==

||<width="50%"> '''Markup''' || '''Result'''   ||
====
||  `''italic''`     || ''italic''       ||
||  `'''bold'''`     || '''bold'''       ||
||  `__underline__`  || __underline__   ||
||  `^super^script`  || ^super^script    ||
||  `,,sub,,script`  || ,,sub,,script    ||
||  `~-smaller-~`    || ~-smaller-~     ||
||  `~+larger+~`     || ~+larger+~       ||
|| `--(stroke)--`    || --(stroke)--     ||

== Linking ==

Moin2 hyperlinks are enclosed within double brackets. There are three possible fields separated by “|” characters:

    1. PageName, relative URL, fully qualified URL, or interwiki link
    1. Text description or transcluded icon: `[[ItemName|{{MyLogo.png}}]]`
    1. Parameters: target, title, download, class, and accesskey are supported

The special CSS class `redirect` may be used to immediately redirect the browser to an internal or external page.
Once placed inside an item, that item cannot be viewed as redirection is immediate.
To edit the item, type …/+modify/ItemName in the browsers address bar.

=== Internal Links ===

The examples below use the "help-en" and "help-common" namespaces to separate these help pages from the main wiki content. Some target pages may be missing from the default namespace.

Within MoinWiki and Creole syntax:
 * a simple link like `[[Home]]` links to an item in the default namespace
 * a relative link like `../Home` links to a sibling in the current namespace
 * a link that begins with a namespace like `[[users/Home]]` links to the Home item in the target namespace
 * a link beginning with / like `[[/subitem]]` links to a subitem of the current item

||<width="50%"> '''Markup''' || '''Result # Comment''' ||
====
|| `[[Home]]` || [[Home]] # Home item in default namespace||
|| `[[help-en/Home]]` || [[help-en/Home]] # Home item in help-en namespace||
|| `[[help-en/Home/subitem]]` || [[help-en/Home/subitem]] # link to a sibling's subitem||
|| `[[help-en/moin/MissingSubitem]]` || [[help-en/moin/MissingSubitem]] # subitem of current item||
|| `[[../Home]]` || [[../Home]] # sibling of current item||
|| `[[/HighlighterList]]` || [[/HighlighterList]] # subitem of this item||
|| `[[help-en/Home|click me]]` || [[help-en/Home|click me]] # show descriptive text not link text||
|| `[[Home|{{help-common/logo.png}}]]` || {{help-common/logo.png}} # show logo image not link text||
|| `[[#Lists]]` || [[#Lists]] # link to a heading anchor within this item||
|| `[[#Lists|show me lists]]` || [[#Lists|show me lists]] # link to Lists heading||
|| `[[help-en/creole#Internal_Links]]` || [[help-en/creole#Internal_Links]] # link to Internal Links within creole item||
|| `[[help-en/creole#Internal_Links|show creole Internal Links]]` || [[help-en/creole#Internal_Links|show creole Internal Links]] ||
|| `[[MissingPage]]` || [[MissingPage]] # links to default namespace||
|| `[[help-en/creole|show creole in new tab|target=_blank]]` || [[help-en/creole|show creole in new tab|target=_blank]] ||
|| `[[../creole|show creole in new tab|target=_blank,class=orange]]` || [[../creole|show creole in new tab|target=_blank,class=orange]] ||
|| `[[../creole|click to download creole|download=creole,title="Hi"]]` || [[../creole|click to download creole|download=creole,title="Hi"]] ||
|| `[[../creole|accesskey demo|accesskey=1]]` || [[../creole|accesskey demo|accesskey=1]] # key alt-shift-1 to load creole||
|| `[[AltItem| |class="redirect"]]` || Not active, causes immediate redirect to AltItem ||

=== External Links ===

||<width="50%"> '''Markup''' || '''Result''' ||
====
|| `[[https://moinmo.in/| |title="go there!"]]` || [[https://moinmo.in/| |title="go there!"]] ||
|| `[[https://moinmo.in/|MoinMoin Wiki|class=orange]]` || [[https://moinmo.in/|MoinMoin Wiki|class=orange]] ||
|| `[[https://static.moinmo.in/logos/moinmoin.png]]` || [[https://static.moinmo.in/logos/moinmoin.png]] ||
|| `[[https://static.moinmo.in/logos/moinmoin.png|moinmoin.png]]` || [[https://static.moinmo.in/logos/moinmoin.png|moinmoin.png]] ||
|| `[[MeatBall:InterWiki]]` || [[MeatBall:InterWiki]] ||
|| `[[MeatBall:InterWiki|InterWiki page on MeatBall]]` || [[MeatBall:InterWiki|InterWiki page on MeatBall]] ||
|| `[[file://///server/share/filename%20with%20spaces.txt|link to filename.txt]]` || [[file://///server/share/filename%20with%20spaces.txt|link to filename.txt]] ||

== Transclusions ==

Transclusion syntax is defined as follows:

{{{
{{<target>|<optional alternate text>|<optional parameters>}}

{{bird.jpg|rare yellow bird|class=center}}
}}}

 * `<target>` is a relative or absolute URL pointing to an image, video, audio, or web page.
 * `<optional alternate text>` has several potential uses:
   * Screen readers used by visually impaired users will speak the text.
   * The alternate text may be displayed by the browser if the URL is broken.
   * Search engine crawlers may use the text to index the page or image.
 * `optional parameters` may be used to resize or position the target.
   * Images or other targets can be resized on the client side by specifying an option of `width=nn` or `height=nn` where nn is the desired size in pixels.
   * If Pillow is installed on the server, JPEG (or JPG) images can be resized on the server by specifying an option of `&w=nn` or `&h=nn` where nn is the desired size in pixels.
   * Images embedded within text can be positioned relative to a line of text by using `class=bottom`, `class=top` or `class="middle"`.
   * Images displayed as block elements my be floated left or right by using `class="left"` or `class=right` respectively, or centered by using `class=center`.

{{{#!wiki caution
When transcluding content from a different web site,
browsers may suppress transcluded content having a protocol different
(HTTP/HTTPS) than the parent page. Some browsers may provide a warning
icon or message.
}}}

'''Markup:'''

{{{
 1. Images are aligned to bottom {{help-common/logo.png}} of text by default.
 1. This image is the big logo floated to the right: {{help-common/logo.svg|my svg|class=right}}
 1. Image aligned to top of text. {{help-common/cat.jpg||&w=75 class=top}}
 1. Image aligned to middle of text. {{http://static.moinmo.in/logos/moinmoin.png||class=middle}}
 1. Transclude an HTTP web page: <<BR>>{{http://www.xkcd.com/||width=800}}
 1. Transclude an HTTPS web page: <<BR>>{{https://moinmo.in||width=800}}
 1. Transclude a subitem: {{/subitem}}
}}}

'''Result:'''
 1. Images are aligned to bottom {{help-common/logo.png}} of text by default.
 1. This image is the big logo floated to the right: {{help-common/logo.svg|my svg|class=right}}
 1. Image aligned to top of text. {{help-common/cat.jpg||&w=75 class=top}}
 1. Image aligned to middle of text. {{http://static.moinmo.in/logos/moinmoin.png||class=middle}}
 1. Transclude an HTTP web page: <<BR>>{{http://www.xkcd.com/||width=800}}
 1. Transclude an HTTPS web page: <<BR>>{{https://moinmo.in||width=800}}
 1. Transclude a subitem: {{/subitem}}

== Blockquotes and Indentations ==

The most common use of blockquotes is to indent several lines of text at the same level. In this case the lines will be combined, word-wrapped as a single paragraph, and displayed as indented text.

When blockquotes contain several levels of indentation, the rendering will be similar to bulletless lists. The difference is that any adjacent lines with the same indentation will be combined and word-wrapped to fit the page width.

In the example below, the second to last line has a leading bulletless list character (a period) that results in the creation of a new list item.

'''Markup:'''

{{{
    indented text
        text indented to the 2nd level
    first level
        second level
        second level again, will be combined with line above
        . second level as no bullet list
        continuation of no bullet list
}}}

'''Result:'''

    indented text
        text indented to the 2nd level
    first level
        second level
        second level again, will be combined with line above
        . second level as no bullet list
        continuation of no bullet list

== Lists ==
=== Unordered Lists ===

'''Markup:'''

{{{
 * item 1

 * item 2 (preceding white space)
  * item 2.1
   * item 2.1.1
 * item 3
  . item 3.1 (bulletless)
 . item 4 (bulletless)
  * item 4.1
  * item 4.2
   . item 4.2.1 (bulletless)
   . item 4.2.2 (bulletless)
}}}

'''Result:'''

 * item 1

 * item 2 (preceding white space)
  * item 2.1
   * item 2.1.1
 * item 3
  . item 3.1 (bulletless)
 . item 4 (bulletless)
  * item 4.1
  * item 4.2
   . item 4.2.1 (bulletless)
   . item 4.2.2 (bulletless)

=== Ordered Lists ===
==== With Numbers ====

'''Markup:'''

{{{
 1. item 1
   1. item 1.1
   1. item 1.2
 1. item 2
}}}

'''Result:'''

 1. item 1
   1. item 1.1
   1. item 1.2
 1. item 2

==== With Roman Numbers ====

'''Markup:'''

{{{
 I. item 1
   i. item 1.1
   i. item 1.2
 I. item 2
}}}

'''Result:'''

 I. item 1
   i. item 1.1
   i. item 1.2
 I. item 2

==== With Letters ====

'''Markup:'''

{{{
 A. item A
   a. item A. a
   a. item A. b
 A. item B
}}}

'''Result:'''

 A. item A
   a. item A. a
   a. item A. b
 A. item B

==== Specify a Starting Point ====

When there is a need to start an ordered list at a specific number, use the format below. This works for ordered lists using letters and roman numerals.

'''Markup:'''

{{{
 1.#11 eleven
 1. twelve
    i.#11 roman numeral xi
 1. thirteen

 A.#11 letter K
 A. letter J
}}}

'''Result:'''

 1.#11 eleven
 1. twelve
    i.#11 roman numeral xi
 1. thirteen

 A.#11 letter K
 A. letter J

=== Definition Lists ===

'''Markup:'''

{{{
 term:: definition
 object::
 :: description 1
 :: description 2
}}}

'''Result:'''

 term:: definition
 object::
 :: description 1
 :: description 2

== Horizontal Rules ==

To create a horizontal rule, start a line with 4 or more hyphen (-) characters. Nine (or more)
characters creates a line of maximum height.

'''Markup:'''

{{{
----
text
------
text
---------
}}}

'''Result:'''

----
text
------
text
---------

== Tables ==

'''Markup:'''

{{{
||'''A'''||'''B'''||'''C'''||
||1      ||2      ||3      ||
}}}

'''Result:'''

||'''A'''||'''B'''||'''C'''||
||1      ||2      ||3      ||

=== Sortable with Headers and Footers ===

Use 3 or more equal characters to separate headers and footers from the table body.  Footers are optional. Adding the moin-sortable table class makes the table sortable on the client side.

'''Markup:'''

{{{
||<tableclass="moin-sortable">Fruit||Quantity||
=====
||Apple||2||
||Orange||1||
||Banana||4||
===
||Total||7||
}}}

'''Result:'''

||<tableclass="moin-sortable">Fruit||Quantity||
=====
||Apple||2||
||Orange||1||
||Banana||4||
===
||Total||7||


=== Cell Width ===

'''Markup:'''

{{{
||minimal width ||<99%>maximal width ||
}}}

'''Result:'''

||minimal width ||<99%>maximal width ||

=== Spanning Rows and Columns  ===

'''Markup:'''

{{{
||<|2> cell spanning 2 rows ||cell in the 2nd column ||
||cell in the 2nd column of the 2nd row ||
||<-2> cell spanning 2 columns ||
||||use empty cells as a shorthand ||
}}}

'''Result:'''

||<|2> cell spanning 2 rows ||cell in the 2nd column ||
||cell in the 2nd column of the 2nd row ||
||<-2> cell spanning 2 columns ||
||||use empty cells as a shorthand ||

=== Alignment of Cell Contents ===

'''Markup:'''

{{{
||<^|3> top (combined) ||<:99%> center (combined) ||<v|3> bottom (combined) ||
||<)> right ||
||<(> left ||
}}}

'''Result:'''

||<^|3> top (combined) ||<:99%> center (combined) ||<v|3> bottom (combined) ||
||<)> right ||
||<(> left ||

=== Coloured Table Cells ===

'''Markup:'''

{{{
||<#0000FF> blue ||<#00FF00> green    ||<#FF0000> red    ||
||<#00FFFF> cyan ||<#FF00FF> magenta  ||<#FFFF00> yellow ||
}}}

'''Result:'''

||<#0000FF> blue ||<#00FF00> green    ||<#FF0000> red    ||
||<#00FFFF> cyan ||<#FF00FF> magenta  ||<#FFFF00> yellow ||

=== HTML-like Options for Tables ===

Keywords include: bgcolor, rowbgcolor, tablebgcolor, width, tablewidth, class, rowclass, tableclass, style, rowstyle, tablestyle, id, rowid, tableid, rowspan, colspan and caption. Separate multiple options with spaces.

'''Markup:'''

{{{
||<caption="My Table" tablewidth="30em">A ||<rowspan="2" > like <|2> ||
||<bgcolor="#00FF00"> like <#00FF00> ||
||<colspan="2"> like <-2>||

||<tableclass="no-borders">A||B||C||
||1||2||3||
}}}

'''Result:'''

||<caption="My Table" tablewidth="30em">A ||<rowspan="2" > like <|2> ||
||<bgcolor="#00FF00"> like <#00FF00> ||
||<colspan="2"> like <-2>||

||<tableclass="no-borders">A||B||C||
||1||2||3||


== Preformatted code ==

To show plain text preformatted code, just enclose the text in three or more curly braces.

'''Markup:'''

{{{{{
{{{
no indentation example
}}}

    {{{{
    {{{
    indentation; using 4 curly braces to show example with 3 curly braces
    }}}
    }}}}
}}}}}

'''Result:'''

{{{
no indentation example
}}}

    {{{{
    {{{
    indentation; using 4 curly braces to show example with 3 curly braces
    }}}
    }}}}

== Parsers ==

Parsers are useful for rendering or highlighting small amounts of code written in another markup language.  For large amounts of code, it may be preferable to create a separate item that can be inserted using a [[#Transclusions|transclusion]].

=== Highlight ===

The highlight parser is implemented using Pygments. Pygments supports many languages. See [[../moin/HighlighterList]] for a list of all languages.

{{{{
{{{#!highlight python
def hello():
   print "Hello World!"
}}}
}}}}

'''Result:'''

{{{#!highlight python
def hello():
   print "Hello World!"
}}}

=== creole, rst, markdown, docbook, and mediawiki ===

To add a small section of markup using another parser, follow the example below replacing "creole" with the target parser name. The moinwiki parser does not have the facility to place table headings in the first column, but the creole parser can be used to create the desired table.

'''Markup:'''

{{{{
{{{#!creole
|=X|1
|=Y|123
|=Z|12345
}}}
}}}}

'''Result:'''

{{{#!creole
|=X|1
|=Y|123
|=Z|12345
}}}

=== csv ===

The default separator for CSV cells is a semi-colon (;). The example below specifies a comma (,) is to be used as the separator.

'''Markup:'''

{{{{
{{{#!csv ,
Fruit,Color,Quantity
apple,red,5
banana,yellow,23
grape,purple,126
}}}
}}}}

'''Result:'''

{{{#!csv ,
Fruit,Color,Quantity
apple,red,5
banana,yellow,23
grape,purple,126
}}}

=== wiki ===

The wiki parser is the moinwiki parser. If there is a need to emphasize a section, pass some predefined classes to the wiki parser.

'''Markup:'''

{{{{
{{{#!wiki solid/orange
 * plain
 * ''italic''
 * '''bold'''
 * '''''bold italic.'''''
}}}
}}}}

'''Result:'''

{{{#!wiki solid/orange
 * plain
 * ''italic''
 * '''bold'''
 * '''''bold italic.'''''
}}}

=== Admonitions ===

Admonitions are used to draw the reader's attention to an important paragraph. There are nine admonition types: attention, caution, danger, error, hint, important, note, tip, and warning.

'''Markup:'''

{{{{
 {{{#!wiki caution
 '''Don't overuse admonitions'''

 Admonitions should be used with care. A page riddled with admonitions will look restless and will be harder to follow than a page where admonitions are used sparingly.
 }}}
}}}}

'''Result:'''

{{{#!wiki caution
'''Don't overuse admonitions'''

Admonitions should be used with care. A page riddled with admonitions will look restless and will be harder to follow than a page where admonitions are used sparingly.
}}}

=== CSS classes for use with the wiki parser, tables and comments ===

 * Background colors: red, green, blue, yellow or orange
 * Borders: solid, dashed or dotted
 * Text-alignment: left, center, right or justify
 * Admonitions: caution, important, note, tip or warning
 * Tables: moin-sortable, no-borders
 * Comments: comment
 * position parsers and tables: float-left, float-right, inline, middle, clear-right, clear-left or clear-both

== Variables ==

Variables within the content of a moin wiki item are transformed when the item is saved. An exception is if the item has a tag of '''template''', then no variables are processed. This makes variables particularly useful within template items. Another frequent use is to add signatures (`@``SIG@`) to a comment within a discussion item.

Variable expansion is global and happens everywhere within an item, including code displays, comments, tables, headings, inline parsers, etc.. Variables within transclusions are not expanded because they are not part of the including item's content.

'''MOINTODO:''' Allow wiki admins and users to add custom variables. There is no difference between system date format and user date format in Moin 2, fix code or docs.

=== Predefined Variables ===

|| '''Variable'''              || '''Description'''                       || '''Resulting Markup'''                  || '''Example Rendering''' ||
====
|| @``PAGE@                    || Name of the item (useful for templates) || `HelpOnPageCreation`                    || HelpOnPageCreation     ||
|| @``ITEM@                    || Name of the item (useful for templates) || `HelpOnPageCreation`                    || HelpOnPageCreation     ||
|| @``TIMESTAMP@               || Raw time stamp                          || `2004-08-30T06:38:05Z`                  || 2004-08-30T06:38:05Z   ||
|| @``DATE@                    || Current date in the system's format     || `<<Date(2004-08-30T06:38:05Z)>>`        || <<Date(2004-08-30T06:38:05Z)>> ||
|| @``TIME@                    || Current date and time in the user's format || `<<DateTime(2004-08-30T06:38:05Z)>>` || <<DateTime(2004-08-30T06:38:05Z)>> ||
|| @``ME@                      || user's name or "anonymous"              || `TheAnarcat`                            || TheAnarcat ||
|| @``USERNAME@                || user's name or his domain/IP      || `TheAnarcat`                                  || TheAnarcat ||
|| @``USER@                    || Signature "-- loginname"                || `-- TheAnarcat`                         || -- TheAnarcat ||
|| @``SIG@                     || Dated Signature "-- loginname date time"     || `-- TheAnarcat <<DateTime(2004-08-30T06:38:05Z)>>` || -- TheAnarcat <<DateTime(2004-08-30T06:38:05Z)>> ||
|| @``EMAIL@                   || Replaced with `<<MailTo()>>` macro with editor's obfuscated email address ||`<<MailTo(testuser AT example DOT com)` ||testuser@example.com <<BR>> or <<BR>> testuser AT example DOT com ||
|| @``MAILTO@                  || Replaced with `<<MailTo()>>` macro with editor's email address||`<<MailTo(testuser@example.com)`  ||`testuser@example.com` -- no obfuscation, use @``EMAIL@ on public sites ||

'''Notes:'''

@``PAGE@ and @``ITEM@ results are identical, item being a moin 2 term and page a moin 1.x term.

If an editor is not logged in, then any @``EMAIL@ or @``MAILTO@ variables in the content are made harmless by inserting a space character. This prevents a subsequent logged in editor from adding his email address to the item accidentally.

== Macros ==

Macros are extensions to standard markup that allow developers to add extra features. See [[../MoinWikiMacros]] for a list of all macros.

=== FootNotes ===

'''Markup:'''

{{{
Footnotes can be placed by using the macro syntax.<<FootNote(A macro is enclosed in double angle brackets.)>>
}}}

'''Result:'''

Footnotes can be placed by using the macro syntax.<<FootNote(A macro is enclosed in double angle brackets.)>>

== Smileys and Icons ==

(!) To insert a smiley icon into your wiki content, type in the markup characters from the table below. Be sure to include a
space character before and after the smiley text, or add the smiley text at the beginning or end of a line. :)

||Markup||Display||Emotion   ||
==========
||`X-(` || X-(   ||angry     ||
||`:D`  || :D    ||biggrin   ||
||`>:>` || >:>   ||devil     ||
||`<:(` || <:(   ||frown     ||
||`:\`  || :\    ||ohwell    ||
||`:o`  || :o    ||redface   ||
||`:-(` || :-(   ||sad       ||
||`:(`  || :(    ||sad       ||
||`:)`  || :)    ||smile     ||
||`B)`  || B)    ||smile2    ||
||`:))` || :))   ||smile3    ||
||`;)`  || ;)    ||smile4    ||
||`|)`  || |)    ||tired     ||
||`|-)` || |-)   ||tired     ||
||`:-?` || :-?   ||tongue    ||
||`/!\` || /!\   ||alert     ||
||`<!>` || <!>   ||attention ||
||`(./)`|| (./)  ||checkmark ||
||`{X}` || {X}   ||icon-error||
||`{i}` || {i}   ||icon-info ||
||`(!)` || (!)   ||idea      ||
||`{1}` || {1}   ||prio1     ||
||`{2}` || {2}   ||prio2     ||
||`{3}` || {3}   ||prio3     ||
||`{*}` || {*}   ||star_on   ||
||`{o}` || {o}   ||star_off  ||
||`{OK}`|| {OK}  ||thumbs-up ||

== Media ==

'''Markup:'''

{{{
{{help-common/video.mp4}}

{{help-common/audio.mp3}}
}}}

'''Result:'''

{{help-common/video.mp4}}

{{help-common/audio.mp3}}

== Comments ==

There are three ways to add comments to a page. Lines starting with ## can be seen only by page editors. Phrases enclosed in `/*` and `*/` and wiki parser blocks of text with a class of “comment” may be hidden or visible depending upon user settings or actions.

Logged in users may set User Preferences to display or hide comments, overriding the default setting in the wiki configuration.

'''Markup:'''

{{{{
## Lines starting with "##" may be used to give instructions
## to future page editors.

Click on "Comments" within Item Views to toggle the /* comments */ visibility.

{{{#!wiki comment/dashed
This is a wiki parser section with class "comment dashed" (see HelpOnParsers).

Its visibility gets toggled the same way.
}}}
}}}}

'''Result:'''

## Lines starting with "##" may be used to give instructions
## to future page editors.

Click on "Comments" within Item Views to toggle the /* comments */ visibility.

{{{#!wiki comment/dashed
This is a wiki parser section with class "comment dashed" (see HelpOnParsers).

Its visibility gets toggled the same way.
}}}
