MediaWiki to YAML Converter
Transform MediaWiki tables into YAML format with automatic type detection, customizable indentation, and flexible output options
MediaWiki Input
YAML Output
About MediaWiki to YAML Converter
Convert MediaWiki table markup to YAML (YAML Ain't Markup Language) format. YAML is a human-readable data serialization language commonly used for configuration files, data exchange, and infrastructure as code.
Key Features
- Array of Objects: Generate clean, readable YAML structure
- Type Detection: Automatically detect null, boolean, integer, float, and string types
- Customizable Indentation: Choose 2, 3, or 4 space indentation
- Key Sanitization: Convert headers to valid YAML keys
- String Quoting: Automatic quoting for values with special characters
- Comments: Optional metadata and row number comments
- Custom Array Name: Specify your own root array name
- 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 .yaml or .yml file
How to Use
- Input MediaWiki Table: Paste your MediaWiki table markup or upload a .wiki file
- Configure Array Name: Set the desired root array name
- Adjust Indentation: Choose your preferred indent size (2-4 spaces)
- Toggle Options: Enable/disable type detection and comments
- Review Output: The YAML output updates automatically
- Export: Copy to clipboard or download as .yaml file
YAML Structure
- Root Array: Named array containing all records
- Array Items: Each row as a dictionary/object (- syntax)
- Key-Value Pairs: Column headers as keys, cell data as values
- Indentation: Consistent spacing for hierarchy
Example Conversion
MediaWiki Input:
{| class="wikitable" border="1"
! Name !! Age !! City !! Active
|-
| John Doe || 28 || New York || true
|-
| Jane Smith || 34 || London || false
|} YAML Output:
data:
-
Name: John Doe
Age: 28
City: New York
Active: true
-
Name: Jane Smith
Age: 34
City: London
Active: false Common Use Cases
- Configuration Files: Create config files for applications
- Docker Compose: Generate docker-compose.yml configurations
- Kubernetes: Create K8s manifests and configs
- Ansible: Generate Ansible playbooks and inventories
- CI/CD Pipelines: Create GitHub Actions, GitLab CI configs
- OpenAPI/Swagger: Generate API specifications
- Data Serialization: Store structured data in human-readable format
- Settings Management: Application settings and preferences
YAML Compatibility
This converter generates YAML 1.2 compliant output that works with:
- Python (PyYAML, ruamel.yaml)
- Ruby (Psych)
- JavaScript/Node.js (js-yaml)
- Go (gopkg.in/yaml.v3)
- Docker and Docker Compose
- Kubernetes
- Ansible
- GitHub Actions, GitLab CI
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
Type Detection
When auto-detect is enabled, the converter recognizes:
- Null: Empty values, "null", or "~"
- Boolean: true, false, yes, no (case-insensitive)
- Integer: Whole numbers (e.g., 42, -10)
- Float: Decimal numbers (e.g., 3.14, -0.5)
- String: Any other text (quoted if needed)
String Quoting Rules
Values are automatically quoted when they:
- Start with special YAML characters (!, &, *, ?, |, >, @, `, [, ], {}, %)
- Contain colons (:) or hash symbols (#)
- Start or end with spaces
- Could be misinterpreted as other types
Indentation Options
- 2 spaces: Most common, compact format
- 3 spaces: Middle ground option
- 4 spaces: More readable, matches some style guides
Comments Feature
When enabled, adds helpful comments:
- File header with generation timestamp
- Row numbers for easy reference
- Metadata about the conversion
- Useful for debugging and documentation
Tips for Best Results
- Use 2-space indentation for most YAML files (standard convention)
- Enable type detection for accurate data representation
- Use descriptive array names that match your use case
- Include comments for documentation purposes
- Validate output with a YAML linter before use
- Keep column names simple for cleaner YAML keys
- Test with your target application's YAML parser
YAML Best Practices
- Prefer 2-space indentation (YAML standard)
- Use lowercase for boolean values (true/false)
- Quote strings that could be ambiguous
- Avoid tabs - use spaces only
- Keep lines under 80 characters when possible
- Use comments to explain complex structures
- Validate with yamllint or similar tools
Privacy & Security
All conversions happen locally in your browser. Your MediaWiki data is never uploaded to any server, ensuring complete privacy and security.
