MediaWiki Extension/QA/MediaWiki Filter

From Apache OpenOffice Wiki
Jump to: navigation, search

http://meta.wikimedia.org/wiki/Help:Wikitext_examples


You can italicize text by putting 2 apostrophes on each side.

3 apostrophes will bold the text.

5 apostrophes will bold and italicize the text.

(Using 4 apostrophes doesn't do anything special --there are just ' left over ones' that are included as part of the text.)


A single newline generally has no effect on the layout. These can be used to separate sentences within a paragraph. Some editors find that this aids editing and improves the diff function (used internally to compare different versions of a page).

But an empty line starts a new paragraph.


You can break lineswithout a new paragraph.Please use this sparingly.

Please do not start a link or italics or bold on one line and close it on the next.


Put text in a typewriter font. The same font is generally used for computer code.

Strike out or underline text, or write it in small caps. 

Centered text
  • Please note the American spelling of "center".


Section headings

Headings organize your writing into sections. The Wiki software can automatically generate a table of contents from them.

Subsection

Using more "equals" (=) signs creates a subsection.

A smaller subsection

Don't skip levels, like from two to four equals signs.

Start with 2 equals signs not 1 because 1 creates H1 tags which should be reserved for page title.


Level1

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level2

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level2

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level3

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level3

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level4

OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level3

Left: OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level2

Justified: OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level3

Center: OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.

Level1

Right: OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us.


Test


  • Unordered lists are easy to do:
    • Start every line with a star.
      • More stars indicate a deeper level. Previous item continues.
    • A newline
  • in a list

marks the end of the list.

  • Of course you can start again.


  1. Numbered lists are:
    1. Very organized
    2. Easy to follow

A newline marks the end of the list.

  1. New numbering starts with 1.


Here's a definition list:

  1. Word
    Definition of the word
  2. A longer phrase needing definition
  3. Phrase defined
  4. A word
  5. Which has a definition
  6. Also a second one
  7. And even a third

Begin with a semicolon. One item per line; a newline can appear before the colon, but using a space before the colon improves parsing.


You can even do mixed lists

  1. and nest them
  2. inside each other
    • or break linesin lists. definition lists
      can be
      nested
      too


You can even do mixed lists

  1. and nest them
  2. inside each other
    • or break linesin lists. definition lists
      can be
      nested
      too
  3. ee
  4. ee
    • eee
    • eeee
      • eeeee
      • eeee
    • kjjkjk
  5. klklklkl
  1. aslasasl
  2. salkklas
    1. slsdlsdl
    2. dslksdlksdkl
    3. sdklsdlksd
      1. dsklsdlksdkl
      2. sdklsdlksd
        1. kdsklsdklsd
          1. sdklsdklsdkl
          2. sdklsdlksd
        2. cdkldfkldf
    4. fdkldflkdfkl
    5. dkldflkdf
    6. fdkldfkldf
  3. dfjkdfjkdf
  4. dfjkdfjk

You can add footnotes to sentences using the ref tag -- this is especially good for citing a source.

There are over six billion people in the world.[1]


Here's a link to a page named Official position. You can even say official positions and the link will show[2] up correctly. 

You can put formatting around a link. Example: Wikipedia. 

The first letter of articles is automatically capitalized, so wikipedia goes to the same place as Wikipedia. Capitalization matters after the first letter. 

The weather in London is a page that doesn't exist yet. You could create it by clicking on the link. 

You can link to a page section by its title:

If multiple sections have the same title, add a number. #Example section 3 goes to the third section named "Example section".


You can make a link point to a different place with a piped link. Put the link target first, then the pipe character "|", then the link text.

Or you can use the "pipe trick" so that text in parentheses or text after a comma does not appear.


You can make an external link just by typing a URL: http://www.nupedia.com

You can give it a title: Nupedia

Or leave the title blank: [1]


Linking to an e-mail address works the same way: mailto:someone@example.com or someone 

You can redirect the user to another page. 

Category links do not show up in line but instead at page bottom and cause the page to be listed in the category.

Add an extra colon to link to a category in line without causing the page to be listed in the category: Category:English documentation


The Wiki reformats linked dates to match the reader's date preferences. These three dates will show up the same if you choose a format in your Preferences:


A picture, including alternate text:

File:Wiki.png

You can put the image in a frame with a caption:


This Wiki's logo


File:Wiki.png
This Wiki's logo
A link to Wikipedia's page for the image: Image:Wiki.png Or a link directly to the image itself: Media:Wiki.png

A link to Wikipedia's page for the image: Image:Wiki.png

Or a link directly to the image itself: Media:Wiki.png


Use media: links to link directly to sounds or videos: A sound file 

Here's a link to a page named Official position. You can even say official positions and the link will show[3] up correctly. 

You can put formatting around a link. Example: Wikipedia. 

The first letter of articles is automatically capitalized, so wikipedia goes to the same place as Wikipedia. Capitalization matters after the first letter. 

The weather in London is a page that doesn't exist yet. You could create it by clicking on the link. Here's a link to a page named Official position. You can even say official positions and the link will show[4] up correctly. 

You can put formatting around a link. Example: Wikipedia. 

The first letter of articles is automatically capitalized, so wikipedia goes to the same place as Wikipedia. Capitalization matters after the first letter. 

The weather in London is a page that doesn't exist yet. You could create it by clicking on the link. Here's a link to a page named Official position. You can even say official positions and the link will show[5] up correctly. 

You can put formatting around a link. Example: Wikipedia. 

The first letter of articles is automatically capitalized, so wikipedia goes to the same place as Wikipedia. Capitalization matters after the first letter. 

The weather in London is a page that doesn't exist yet. You could create it by clicking on the link. 

Textural 1:1 Textural 1:2
Textural 2:1
Textural 2:2
Table


Textural 1:1 Textural 1:2 Textural 1:3 Textural 1:4
Textural 2:1
Textural 2:2
Textural 2:3
Textural 2:4
Textural 3:1
Textural 3:2
Textural 3:3
Textural 3:4
Textural 4:1
Textural 4:2
Textural 4:3
Textural 4:4
Table


Textural 1:1
Textural 1:2
1:3
Textural 1:4
Textural 2:1
Textural 2:2
Textural 2:3
Textural 3:1 4:1
Textural 3:2
Textural 4:2
Textural 4:3


Textural 2:4 3:4 4:4
Table2


Textural 1:1
Textural 1:2
Textural A
Textural 1:4
Textural 2:1
Textural 2:2
Textural 2:3
Textural Textural Textural Textural 2:4
Textural 3:1
Textural 3:2
Textural 3:3
Textural 3:4
Textural 4:1 Textural Textural Textural Textural Textural
Textural 4:2
Textural 4:3
Textural 4:4
Textural
Textural
Textural
Textural
Textural


Table3

  1. # CIA World Factbook, 2006. For details, see Wikipedia:Footnotes and Help:Footnotes.
  2. More information
  3. More information
  4. More information
  5. More information





ODT2Wiki: OpenDocument to MediaWiki conversion

There are two main open formats for storing knowledge and information in a future-proof way. The one format is OpenDocument, which is used by OpenOffice.org and many other contemporary office suites. The other one is the format used for editing the Wikipedia global knowledge base. The later format is defined by the WikiMedia wiki engine.

This document in combination with the odt2wiki transformation demonstrates how to establish interoperability between these formats.

Supported Features

OpenDocument and WikiMedia are by now way equivalent. While OpenDocument has its main focus on sophisticated presentation and styling, WikiMedia format is designed to be collaboratively editable in a non-wysiwyg fashion using minimal markup. Due to this differences in the objective, one cannot expect a perfect result, when converting from OpenDocument to WikiMedia. However, there is a common subset of formatting that can be reliably converted from OpenDocument to WikiMedia. At the one hand, this document describes this portable subset. On the other hand, it serves as a benchmark document for the transformation, since it is written itself in OpenDocument and can therefore be transformed to WikiMedia.

Headings

While headings can be thoroughly formatted in OpenDocument, their format is defined by the style applied by the wiki engine. During export to WikiMedia format, style information of headings is lost and the default heading style is applied by the wiki engine. The headings of this document serve as example for the transformation of headings.

Hyperlinks

Native OpenDocument hyperlinks are transformed into “external” wiki links during the transformation. Therefore, the built-in linking facility of OpenDocument should only be used, when generating links pointing to other sites outside the wiki web. For generating wiki links that point to other subjects of the same wiki domain (e.g. Wikipedia), use wiki links explained below.

Lists

To have lists reliably exported, you must make sure, that the whole list has assigned a consistent list style.

Bullet Lists

An example for an unordered list with bullets:

  • The first item.
  • The second item
  • The third item
    • A sub-item.
    • Another sub-item
      • A sub-sub-item
    • Level two continued
  • Level one continued

Pure Indented Lists

The list bullets may also be omitted. To have those lists exported reliably, make sure to really use a list style instead of several paragraph styles with increasing indentation.

The first list item
The second list item
A sub-item
Another sub-item
A sub-sub-item
Continued with level two.
Continued with level one.

Numbered Lists

An example for a numbered list:

  1. The first item.
  2. The second item
  3. The third item
    1. A sub-item.
    2. Another sub-item
      1. A sub-sub-item
    3. Level two continued
  4. Level one continued

Mixed lists

Numbered and unordered lists can be mixed within separate levels of the same list:

  • The first item.
  • The second item
  • The third item
    1. A sub-item.
    2. Another sub-item
      A sub-sub-item without bullet or numbering
      Another sub-sub-item
    3. Level two continued
  • Level one continued

Paragraphs

Alignment

Explicit text alignment should not be used in regular Wikipedia articles. Nevertheless, text alignment is supported by the odt2wiki transformation. An example follows:

Regular text aligned to the left.

Centered text.
Text aligned to the right.

Pre-formatted text

A paragraph style with a fixed-width font face is interpreted as pre-formatted text by the transformation. A opposed to typewriter character style, pre-formatted text is rendered with a border in the wiki engine like in the example below:

Some code example.

A paragraph with
explicit line breaks
to get better structuring

# Some comment
Some paragraphs

 with

  indentation

   by

    preceeding

     spaces.

Character styles

Character styles modify the appearance of only parts of a paragraph. The character styles supported by the transformation are discussed next.

Bold

Some text within a paragraph may be set in bold style.

Italics

Like bold, italics is also supported. Especially, the combination of both styles works as well.

Being of no special use in real text, the complexity of the transformation increases noticeably by supporting text that joins these styles without intermediate space:

  • bolditalics,
  • italicsbold,
  • bolditalicsbold,
  • italicsbolditalics,
  • italicsboldanditalicsitalics,
  • boldboldanditalicsbold,
  • boldanditalicsboldboldanditalics, and
  • boldanditalicsitalicsboldanditalics.

Named, Linked and Nested Styles

OpenDocument styles can be linked together and multiple styled elements may be nested. The resulting formatting is the union of all these styles, where the innermost definition of a property wins.

  • Style A declaring bold.
  • Style B based on A declaring typewriter.
  • Style C based on B declaring bold and italics.
  • Style D based on C declaring normal font face.
  • Style E based on D, again declaring bold.

Subscript

Subscript text is especially useful for setting indexes in simple formulas. x1, x2,..., xn.

Superscript

Even if a math environment is preferred, the combination of italics style with subscript and superscript is very common for simple formulas in Wikipedia articles: fn(x) = xn – 3x2 + 2.

Typewriter

When describing programs or algorithms, a common style is to set references to program elements such as variables or classes in typewriter font. The transformation translates all font faces with fixed width into the wiki typewriter style.

Footnotes

Note: The transformation uses the new style of footnotes with <ref> and <references> tags that requires the Cite.php extension to be installed into MediaWiki. If those tags occur as plain text in the transformation result, please install this extension.

Articles may be enriched with footnotes.[1] Footnotes are especially useful for citing the origin of some information.[2] Referencing the same footnote twice[1] is also supported by the transformation.

Images

Abbildung 1: Kreuztor in Ingolstadt, Germany.
Images in general cannot be exported by a transformation producing a single file of wiki text. However, if the image is already uploaded to the target wiki domain[3] (e.g. WikiMedia Commons), then the transformation produces a valid image tag that includes the image. Image descriptions are also supported.

Tables

Tables are a natural way of presenting multiple pieces of equally structured information.

Table Headers

Simple tables are supported well. Table headers are translated into corresponding wiki-style table headers. However, custom formatting of table borders, column sizes and background colors is ignored.


Header 1
Header 2
Header 3
Information 1.1 Information 1.2 Information 1.3
Information 2.1 Information 2.2 Information 2.3

Joined Cells

OpenDocument and especially OpenOffice.org represent tables that have joined cells that span rows as tables with nested tables. In contrast, the wiki model of table is to declare column and row spans for such joined cells.

If only columns of the same row are joined, the result of the transformation resembles the source document very well:


Joined header cell 1 and 3
Header 3
Cell 1.1 Cells 1.2 Cell 1.3
Cell 2.1 Joined cells 2.2 and 2.3

However, the transformation does not support tables with joined cells that span multiple rows. If the source document uses such tables, nested tables are observed in the result document.


Joined header cell with cell 1.1
Header 2
Cell 1.2
Joined header cell 3 and cell 1.3
Cell 2.1 Cell 2.2 Cell 2.3

Borders

Irrespective of custom table styles for border and background, a table is always exported as “prettytable”, which renders in the wiki engine with simple borders and bold header.

Charset ans special characters

The charset of the transformation result is fixed to UTF-8. Depending on your system, this might not be the default charset. This might cause “special character” to look broken, when viewed with default settings. However, can switch your editor to UTF-8 encoding to fix this. If your editor does not support switching the encoding, you can display the result of the transformation in the Firefox browser and switch the encoding to UTF-8 there. Now, you can cut and paste the transformation result to your program of choice.

Direct Wiki Input

WikiMath

WikiLink

Unsupported Features

Hyperlinks

Document-internal Links

Character Styles

Smallcaps

Underline

Strikethrough

Horizontal Rules


  1. 1.0 1.1 A footnote is a piece of text that is taken out of the normal text flow. It usually gives some background information that is not absolutely required for understanding the text.
  2. Please also refer to the Wikipedia howto on footnotes.
  3. The wiki system, to which the result of the transformation is being deployed.
Personal tools