Convert RST to MediaWiki
Max file size 100mb.
RST vs MediaWiki Format Comparison
| Aspect | RST (Source Format) | MediaWiki (Target Format) |
|---|---|---|
| Format Overview |
RST
reStructuredText
Lightweight markup language developed by the Python community in 2001. Primary format for Python documentation, Sphinx, and Read the Docs. Emphasizes simplicity and readability with explicit, consistent syntax for technical documentation. Python Standard Sphinx Native |
MediaWiki
Wiki Markup Language
Markup language used by Wikipedia and thousands of wikis worldwide. Created by Magnus Manske in 2002 for MediaWiki software. Powers the world's largest encyclopedia with collaborative editing and rich interlinking features. Wikipedia Standard Collaborative |
| Technical Specifications |
Structure: Plain text with indentation-based syntax
Encoding: UTF-8 Format: Docutils markup language Processor: Sphinx, Docutils, Pandoc Extensions: .rst, .rest, .txt |
Structure: Plain text with symbol-based markup
Encoding: UTF-8 Format: MediaWiki wikitext Processor: MediaWiki parser, Pandoc Extensions: .wiki, .mediawiki, .mw |
| Syntax Examples |
RST syntax (Python-style): Document Title
==============
Section Header
--------------
This is **bold** and *italic*.
.. code-block:: python
def hello():
print("Hello")
.. note::
Important information here.
|
MediaWiki syntax: = Document Title =
== Section Header ==
This is '''bold''' and ''italic''.
<syntaxhighlight lang="python">
def hello():
print("Hello")
</syntaxhighlight>
{{Note|Important information here.}}
|
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2001 (David Goodger)
Maintained by: Docutils project Status: Stable, actively maintained Primary Tool: Sphinx (2008+) |
Introduced: 2002 (Magnus Manske)
Maintained by: Wikimedia Foundation Status: Actively developed Primary Platform: MediaWiki software |
| Software Support |
Sphinx: Native support
Docutils: Reference implementation Pandoc: Full support IDEs: PyCharm, VS Code (extensions) |
MediaWiki: Native parser
Pandoc: Full support Wikipedia: Primary platform Fandom/Wikia: Full support |
Why Convert RST to MediaWiki?
Converting reStructuredText (RST) documents to MediaWiki format enables you to publish your documentation on wiki platforms like Wikipedia, Fandom, or corporate MediaWiki installations. This is invaluable when migrating technical documentation to collaborative wiki environments.
MediaWiki markup is specifically designed for collaborative editing and rich interlinking. Its template system allows for reusable content components, while categories and namespaces provide powerful organization features. Converting RST documentation to MediaWiki lets you leverage these collaborative features.
The conversion is particularly useful for organizations that want to make their documentation more accessible through wiki platforms. MediaWiki's built-in versioning, discussion pages, and user contributions tracking make it ideal for documentation that needs ongoing community input and maintenance.
While RST excels at generating static documentation through Sphinx, MediaWiki provides a dynamic, web-based editing experience. This conversion bridges the gap between developer-focused documentation and wiki-based knowledge management systems.
Key Benefits of Converting RST to MediaWiki:
- Wikipedia Compatibility: Publish on the world's largest encyclopedia
- Collaborative Editing: Enable community contributions
- Template System: Create reusable content components
- Rich Interlinking: Connect related pages easily
- Version Control: Built-in history and rollback
- Categories: Organize content systematically
- Discussion Pages: Enable community feedback
Practical Examples
Example 1: Basic Document Structure
Input RST file (document.rst):
Getting Started Guide
=====================
Introduction
------------
Welcome to the **project documentation**.
This guide will help you get started.
Installation
------------
Install using pip::
pip install myproject
.. note::
Requires Python 3.8 or higher.
Output MediaWiki file (document.wiki):
= Getting Started Guide =
== Introduction ==
Welcome to the '''project documentation'''.
This guide will help you get started.
== Installation ==
Install using pip:
<syntaxhighlight lang="bash">
pip install myproject
</syntaxhighlight>
{{Note|Requires Python 3.8 or higher.}}
Example 2: Code Blocks and Warnings
Input RST file (code_example.rst):
API Reference
=============
.. code-block:: python
:linenos:
def calculate_total(items):
"""Calculate the total price."""
return sum(item.price for item in items)
.. warning::
This function does not handle empty lists.
Output MediaWiki file (code_example.wiki):
= API Reference =
<syntaxhighlight lang="python" line>
def calculate_total(items):
"""Calculate the total price."""
return sum(item.price for item in items)
</syntaxhighlight>
{{Warning|This function does not handle empty lists.}}
Example 3: Tables and Links
Input RST file (reference.rst):
Configuration Options ===================== +---------------+----------+------------------+ | Option | Default | Description | +===============+==========+==================+ | debug | false | Enable debugging | +---------------+----------+------------------+ | timeout | 30 | Request timeout | +---------------+----------+------------------+ See `Python docs <https://docs.python.org>`_ for more.
Output MediaWiki file (reference.wiki):
= Configuration Options =
{| class="wikitable"
|-
! Option !! Default !! Description
|-
| debug || false || Enable debugging
|-
| timeout || 30 || Request timeout
|}
See [https://docs.python.org Python docs] for more.
Frequently Asked Questions (FAQ)
Q: What is MediaWiki markup?
A: MediaWiki markup is the wiki syntax used by Wikipedia and MediaWiki-powered wikis. It uses symbols like = for headers, ''' for bold, '' for italic, and [[ ]] for internal links. It also supports templates, categories, and special wiki features.
Q: Can I use the converted content on Wikipedia?
A: The converted markup is compatible with Wikipedia's syntax. However, Wikipedia has strict content policies. Make sure your content meets Wikipedia's notability guidelines, citation requirements, and neutral point of view policy before publishing.
Q: How are RST directives converted to MediaWiki?
A: RST directives are converted to MediaWiki templates. Note directives become {{Note|...}}, warnings become {{Warning|...}}, and code blocks become <syntaxhighlight> tags. Some templates may need to exist on your wiki for proper rendering.
Q: What about internal cross-references?
A: RST cross-references are converted to MediaWiki internal links using [[Page Name]] syntax. You may need to adjust page names to match your wiki's naming conventions and create the linked pages.
Q: Do I need to install any templates on my wiki?
A: The conversion uses common templates like {{Note}}, {{Warning}}, and {{Tip}}. These templates are standard on Wikipedia but may not exist on your private wiki. You may need to create or import them.
Q: How are images handled in the conversion?
A: RST images are converted to MediaWiki file syntax [[File:image.png|alt text]]. You'll need to upload the images to your wiki separately, as MediaWiki stores images in its own file repository.
Q: Can I convert MediaWiki back to RST?
A: Yes, Pandoc supports bidirectional conversion. Use: `pandoc -f mediawiki -t rst input.wiki -o output.rst`. This is useful for exporting wiki content back to Sphinx documentation.
Q: What wiki platforms support MediaWiki format?
A: MediaWiki format is supported by Wikipedia, Wikimedia projects, Fandom (formerly Wikia), and any site running MediaWiki software. It's one of the most widely used wiki formats globally.