MediaWiki to reStructuredText Converter

Transform MediaWiki tables into reStructuredText format for Python documentation, Sphinx, and technical writing

MediaWiki Input

reStructuredText Output

About MediaWiki to reStructuredText Converter

Convert MediaWiki table markup to reStructuredText (RST) format for Python documentation, Sphinx documentation generator, and technical writing. Perfect for converting Wikipedia tables to Python documentation format.

Key Features

  • Grid Tables: Robust format with full border support and multi-line cell capability
  • Simple Tables: Clean, minimal syntax for straightforward tables
  • Header Support: Toggle header row with = separator for clear distinction
  • Auto-sizing: Automatically calculates optimal column widths
  • Sphinx Compatible: Works seamlessly with Sphinx documentation generator
  • Python Docs Ready: Perfect for Python package documentation
  • MediaWiki Parser: Accurately parses MediaWiki table syntax
  • File Upload: Upload .wiki files directly
  • Instant Preview: Real-time conversion as you type
  • Copy & Download: Easy export as .rst file

How to Use

  1. Input MediaWiki Table: Paste your MediaWiki table markup or upload a .wiki file
  2. Select Table Style: Choose between Grid or Simple table format
  3. Configure Header: Toggle header row with = separator
  4. Review Output: The RST output updates automatically
  5. Export: Copy to clipboard or download as .rst file

Table Styles

  • Grid Tables: Use +, -, |, and = characters for full borders. Supports multi-line cells and complex layouts. More robust but verbose.
  • Simple Tables: Use spaces and = characters for a cleaner look. Easier to read and edit manually. Limited to single-line cells.

Example Conversion

MediaWiki Input:

{| class="wikitable" border="1"
! Name !! Age !! City !! Department
|-
| John Doe || 28 || New York || Engineering
|-
| Jane Smith || 34 || London || Marketing
|}

Grid Table Output:

+------------+-----+----------+--------------+
| Name       | Age | City     | Department   |
+============+=====+==========+==============+
| John Doe   | 28  | New York | Engineering  |
+------------+-----+----------+--------------+
| Jane Smith | 34  | London   | Marketing    |
+------------+-----+----------+--------------+

Simple Table Output:

============ ===== ========== ==============
Name         Age   City       Department
============ ===== ========== ==============
John Doe     28    New York   Engineering
Jane Smith   34    London     Marketing
============ ===== ========== ==============

Common Use Cases

  • Python Documentation: Create tables for Python package docs
  • Sphinx Projects: Generate tables for Sphinx documentation
  • ReadTheDocs: Prepare content for ReadTheDocs hosting
  • Wikipedia to Docs: Convert Wikipedia tables to documentation format
  • Technical Writing: Write technical documentation with structured data
  • API Documentation: Document API parameters and responses
  • Configuration Docs: Document configuration options and settings
  • Tutorial Content: Create educational content with data tables

MediaWiki Table Syntax

Supports standard MediaWiki table markup:

  • {|: Table opening with optional attributes
  • ! Header: Exclamation mark for header cells (separated by !!)
  • |-: Row separator
  • | Data: Pipe for data cells (separated by ||)
  • |}: Table closing

reStructuredText Table Syntax

  • Grid Tables: Use +, -, |, and = for borders and separators
  • Simple Tables: Use = for row separators and spaces for columns
  • Header Separator: Use = instead of - to mark header rows
  • Column Alignment: Determined by content positioning within cells
  • Multi-line Cells: Supported in grid tables only

Sphinx Integration

These tables work seamlessly with Sphinx directives:

  • Can be used in any .rst file
  • Compatible with all Sphinx themes
  • Supports cross-referencing
  • Works with autodoc and other extensions
  • Renders properly in HTML, PDF, and ePub outputs

Grid Table Features

  • Full Borders: Complete border around all cells
  • Multi-line Support: Cells can contain multiple lines
  • Complex Layouts: Supports column and row spanning (manual editing)
  • Visual Clarity: Easy to see table structure in source
  • Robust Parsing: Less prone to formatting errors

Simple Table Features

  • Clean Syntax: Minimal markup for better readability
  • Easy Editing: Simple to modify manually
  • Compact: Takes less space in source files
  • Quick Creation: Faster to type manually
  • Single-line Cells: Best for simple, concise data

Python Documentation Standards

reStructuredText is the official markup language for:

  • Python Enhancement Proposals (PEPs)
  • Python standard library documentation
  • PyPI package descriptions
  • Sphinx-based documentation projects
  • ReadTheDocs hosted documentation

Wikipedia Integration

Perfect for converting Wikipedia tables:

  • Extract tables from Wikipedia articles
  • Convert to Python documentation format
  • Preserve data structure and formatting
  • Use in educational materials
  • Create reference documentation

Best Practices

  • Use grid tables for complex data with long content
  • Use simple tables for clean, concise data
  • Enable header rows for better table understanding
  • Keep cell content concise for better rendering
  • Test output in Sphinx to verify rendering
  • Use consistent column widths for visual alignment
  • Consider mobile rendering when creating wide tables

Sphinx Directives

You can enhance RST tables with Sphinx directives:

  • .. table:: Add caption and alignment options
  • .. csv-table:: Alternative CSV-based table format
  • .. list-table:: List-based table format
  • :widths: Control column width ratios
  • :align: Set table alignment (left, center, right)

Tips for Best Results

  • Choose grid tables for documentation that may need updates
  • Choose simple tables for static reference data
  • Keep column headers short and descriptive
  • Use consistent terminology across tables
  • Test rendering in your Sphinx build
  • Consider adding table captions with .. table:: directive
  • Validate RST syntax before committing to version control
  • Extract Wikipedia tables for educational content

Privacy & Security

All conversions happen locally in your browser. Your MediaWiki data is never uploaded to any server, ensuring complete privacy and security.