Convert YML to MediaWiki
Max file size 100mb.
YML vs MediaWiki Format Comparison
| Aspect | YML (Source Format) | MediaWiki (Target Format) |
|---|---|---|
| Format Overview |
YML
YAML Ain't Markup Language
Human-readable data serialization format commonly used for configuration files, data exchange, and structured content storage. Uses indentation-based nesting with key-value pairs, lists, and nested mappings. Popular in DevOps, CI/CD pipelines, and application configuration. Data Format Human-Readable |
MediaWiki
MediaWiki Markup Language
Lightweight markup language used by MediaWiki-powered sites, most notably Wikipedia. Designed for creating and editing wiki pages with support for tables, templates, categories, links, and structured content. Focused on collaborative content creation and web publishing. Wiki Markup Web Publishing |
| Technical Specifications |
Structure: Indentation-based hierarchy
Encoding: UTF-8 Format: Plain text with minimal syntax Standard: YAML 1.2 (2009) Extensions: .yml, .yaml |
Structure: Tag-based wiki markup
Encoding: UTF-8 Format: Plain text with wiki syntax Standard: MediaWiki markup specification Extensions: .mediawiki, .wiki, .txt |
| Syntax Examples |
YML uses indentation for structure: server:
name: production
port: 8080
features:
- logging
- caching
- monitoring
|
MediaWiki uses special markup syntax: == Server Configuration ==
{| class="wikitable"
|-
! Key !! Value
|-
| Name || production
|-
| Port || 8080
|}
|
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2001 (Clark Evans)
Current Version: YAML 1.2 (2009) Status: Actively maintained Evolution: 1.0 → 1.1 → 1.2 |
Introduced: 2002 (MediaWiki project)
Current Version: MediaWiki 1.41+ (2024) Status: Actively developed Evolution: Continuously updated with MediaWiki |
| Software Support |
Python: PyYAML, ruamel.yaml
JavaScript: js-yaml, yaml CLI Tools: yq, yamllint Other: All major programming languages |
MediaWiki: Native support
Pandoc: Full read/write support Editors: Visual Editor, WikiEd Other: Parsoid, mwparserfromhell |
Why Convert YML to MediaWiki?
Converting YML files to MediaWiki markup is valuable when you need to publish structured data on a wiki platform. YAML is excellent for storing configuration data and structured information, but it is not designed for human-friendly web presentation. MediaWiki markup transforms that raw data into well-formatted wiki pages with tables, headings, lists, and other visual elements that are easy to read and navigate.
Many teams maintain configuration data, API specifications, server inventories, or project metadata in YML files. When this information needs to be shared with a broader audience through an internal wiki or public documentation site, converting to MediaWiki format bridges the gap between machine-readable data and human-readable documentation. Wiki tables generated from YML data are sortable, searchable, and easy to maintain.
MediaWiki markup powers some of the most widely-read websites in the world, including Wikipedia and its sister projects. The format supports rich content features such as tables with custom styling, categorization, cross-referencing through internal links, and reusable templates. By converting YML data into MediaWiki format, you can leverage these features to create comprehensive, well-organized documentation pages.
The conversion process maps YML structures to their MediaWiki equivalents: key-value pairs become table rows or definition lists, nested objects become subsections with headings, and YAML lists become bulleted or numbered wiki lists. This produces clean, maintainable wiki markup that can be directly pasted into any MediaWiki-based platform.
Key Benefits of Converting YML to MediaWiki:
- Wiki-Ready Output: Produces markup compatible with Wikipedia and all MediaWiki installations
- Structured Tables: YAML key-value pairs become clean, sortable wiki tables
- Readable Documentation: Transforms raw data files into human-friendly wiki pages
- Team Collaboration: Share configuration data with non-technical team members via wiki
- Searchable Content: Wiki pages are indexed and searchable unlike raw YML files
- Version Tracking: MediaWiki provides built-in revision history for all changes
- Template Integration: Output can use MediaWiki templates for consistent formatting
Practical Examples
Example 1: Server Configuration Documentation
Input YML file (servers.yml):
servers:
web-01:
hostname: web-01.example.com
ip: 192.168.1.10
role: frontend
os: Ubuntu 22.04
db-01:
hostname: db-01.example.com
ip: 192.168.1.20
role: database
os: Debian 12
Output MediaWiki file (servers.mediawiki):
== Servers ==
{| class="wikitable sortable"
|-
! Server !! Hostname !! IP Address !! Role !! OS
|-
| '''web-01''' || web-01.example.com || 192.168.1.10 || frontend || Ubuntu 22.04
|-
| '''db-01''' || db-01.example.com || 192.168.1.20 || database || Debian 12
|}
[[Category:Infrastructure]]
Example 2: API Endpoint Documentation
Input YML file (api.yml):
api:
version: "2.0"
base_url: https://api.example.com
endpoints:
- path: /users
method: GET
description: List all users
auth: required
- path: /users
method: POST
description: Create a new user
auth: required
Output MediaWiki file (api.mediawiki):
== API Documentation == '''Version:''' 2.0
'''Base URL:'''https://api.example.com=== Endpoints === {| class="wikitable" |- ! Path !! Method !! Description !! Auth |- |/users|| GET || List all users || {{Yes}} |- |/users|| POST || Create a new user || {{Yes}} |} [[Category:API Documentation]]
Example 3: Project Metadata for Wiki Page
Input YML file (project.yml):
project:
name: DataSync
version: 3.2.1
license: MIT
languages:
- Python
- Go
- TypeScript
maintainers:
- name: Alice Johnson
role: Lead Developer
- name: Bob Smith
role: DevOps Engineer
Output MediaWiki file (project.mediawiki):
== DataSync ==
{{Infobox software
| name = DataSync
| version = 3.2.1
| license = MIT
}}
=== Languages ===
* Python
* Go
* TypeScript
=== Maintainers ===
{| class="wikitable"
|-
! Name !! Role
|-
| Alice Johnson || Lead Developer
|-
| Bob Smith || DevOps Engineer
|}
[[Category:Projects]]
Frequently Asked Questions (FAQ)
Q: What is MediaWiki markup?
A: MediaWiki markup is the formatting language used by MediaWiki-powered websites, most famously Wikipedia. It uses special syntax like double brackets for links, curly braces for templates, pipe characters for tables, and equal signs for headings. The markup is rendered into HTML by the MediaWiki engine, producing well-formatted web pages that support collaboration, versioning, and cross-referencing.
Q: How does YML data map to MediaWiki format?
A: YML key-value pairs are converted into wiki table rows or definition lists. Nested YML objects become subsections with appropriate headings. YAML lists are transformed into bulleted or numbered wiki lists. Complex nested structures can be represented as multiple tables or nested sections, preserving the hierarchical nature of the original YAML data in a human-readable wiki format.
Q: Can I paste the output directly into Wikipedia?
A: Yes, the generated MediaWiki markup is fully compatible with Wikipedia and any MediaWiki installation. You can copy the output and paste it directly into the wiki editor. However, for Wikipedia specifically, you should ensure the content meets their notability guidelines and editorial standards. For internal corporate wikis or documentation wikis, the output can be used as-is.
Q: Are YAML comments preserved in the conversion?
A: YAML comments (lines starting with #) are typically not included in the MediaWiki output since they are metadata intended for developers, not for wiki readers. However, if comments contain important context, they may be converted into HTML comments or descriptive text within the wiki page. The focus is on converting the actual data content into readable wiki format.
Q: How are nested YML structures handled?
A: Deeply nested YAML structures are converted using a combination of MediaWiki headings, subheadings, tables, and nested lists. Top-level keys become section headings (== Heading ==), second-level keys become subsection headings or table headers, and deeper levels are rendered as nested lists or additional table rows. The converter intelligently determines the best MediaWiki representation for each nesting level.
Q: What is the difference between YML and YAML file extensions?
A: There is no difference in the actual format. Both .yml and .yaml are valid extensions for YAML files and contain identical syntax. The .yml extension is more commonly used in practice (especially in Docker Compose and GitHub Actions), while .yaml is the officially recommended extension. Our converter handles both extensions identically, producing the same MediaWiki output regardless of which extension the source file uses.
Q: Can this converter handle large YML files?
A: Yes, the converter efficiently processes YML files of varying sizes. Small configuration files and large data files alike are converted into well-structured MediaWiki markup. For very large files, the output may produce lengthy wiki pages, so consider splitting them into multiple wiki pages or using MediaWiki's transclusion feature to include sections from a master page.
Q: Does the converter support YAML anchors and aliases?
A: Yes, YAML anchors (&anchor) and aliases (*anchor) are resolved during the conversion process. The referenced data is expanded inline in the MediaWiki output, so all alias references display their actual values. This means the wiki page shows the complete, dereferenced data without requiring the reader to understand YAML's reference mechanism.