Convert Typst to MediaWiki
Max file size 100mb.
Typst vs MediaWiki Format Comparison
| Aspect | Typst (Source Format) | MediaWiki (Target Format) |
|---|---|---|
| Format Overview |
Typst
Modern Typesetting System
Typst is a modern typesetting system launched in 2023 as an alternative to LaTeX. It features a clean, intuitive markup syntax combined with a powerful scripting language, fast incremental compilation written in Rust, and built-in support for mathematical typesetting. Typst aims to make professional document creation accessible without the steep learning curve of traditional typesetting systems. Typesetting Modern |
MediaWiki
Wiki Markup Language
MediaWiki markup is the formatting language used by Wikipedia, Wiktionary, Fandom, and thousands of other wiki-based websites powered by the MediaWiki software. Developed alongside Wikipedia starting in 2002, it provides a readable syntax for creating collaborative web content with links, tables, templates, and categories. It is the most widely deployed wiki markup in the world. Wiki Standard Collaborative |
| Technical Specifications |
Structure: Plain text with Typst markup and scripting
Encoding: UTF-8 Format: Modern typesetting language Compiler: Typst CLI (Rust-based) Extensions: .typ |
Structure: Plain text with wiki formatting codes
Standard: MediaWiki markup (no formal spec) Format: Server-rendered markup language Rendering: MediaWiki parser (PHP-based) Extensions: .wiki, .mediawiki, .mw |
| Syntax Examples |
Typst uses = and * for formatting: = Photosynthesis *Photosynthesis* converts light energy into _chemical energy_. - Light reactions - Calvin cycle The equation is: $ 6 "CO"_2 + 6 "H"_2"O" arrow.r "C"_6"H"_12"O"_6 $ |
MediaWiki uses equal signs and apostrophes: == Photosynthesis ==
'''Photosynthesis''' converts light
energy into ''chemical energy''.
* Light reactions
* Calvin cycle
The equation is:
<math>6CO_2 + 6H_2O \rightarrow
C_6H_{12}O_6</math>
[[Category:Biology]]
{{Main|Photosynthesis}}
|
| Content Support |
|
|
| Advantages |
|
|
| Disadvantages |
|
|
| Common Uses |
|
|
| Best For |
|
|
| Version History |
Introduced: 2023 (Typst GmbH)
Written In: Rust Status: Active development, growing adoption Origin: Master's thesis at TU Berlin |
Introduced: 2002 (with MediaWiki software)
Used By: Wikipedia since January 2001 Status: Actively maintained Evolution: UseModWiki → Phase II → MediaWiki → VisualEditor |
| Software Support |
Editors: Typst app, VS Code (Tinymist), Neovim
Compiler: typst CLI (Rust-based, open source) Online: typst.app (official web editor) Packages: Typst Universe (community packages) |
Platforms: Wikipedia, Fandom, Miraheze
Editors: VisualEditor, WikiEditor, VS Code Converters: Pandoc, mw2latex, wiki2latex Other: MediaWiki API, Parsoid parser |
Why Convert Typst to MediaWiki?
Converting Typst to MediaWiki markup bridges modern document creation with the world's largest collaborative knowledge platform. Wikipedia and thousands of other wiki sites use MediaWiki markup to organize and present information. When you convert your Typst documents to MediaWiki format, you make your content ready for publication on any wiki-powered website, enabling collaborative editing and community-driven improvement.
Typst's clean syntax translates naturally to MediaWiki markup. Typst's = headings become == wiki headings ==, *bold* becomes '''bold''', and _italic_ becomes ''italic''. Mathematical expressions from Typst are wrapped in <math> tags, which MediaWiki renders using its built-in LaTeX math support. This means your equations are preserved in a form that Wikipedia and other wikis can display correctly.
This conversion is especially valuable for researchers and educators who want to share their knowledge on Wikipedia or institutional wikis. If you have written detailed technical content in Typst, converting to MediaWiki eliminates the manual work of rewriting content in wiki syntax. You can focus on reviewing and adapting the content for a wiki audience rather than reformatting it from scratch.
For organizations maintaining internal knowledge bases on MediaWiki platforms, converting Typst documents provides an efficient way to populate wikis with well-structured content. Technical documentation, training materials, and research summaries written in Typst can be quickly converted and published to organizational wikis, making knowledge accessible to the entire team.
Key Benefits of Converting Typst to MediaWiki:
- Wikipedia Contribution: Convert documents into wiki articles ready for Wikipedia and Wikimedia projects
- Math Preservation: Mathematical equations transfer to MediaWiki's <math> tags
- Collaborative Editing: Enable wiki communities to collaboratively improve your content
- Knowledge Sharing: Make specialized content accessible to a global audience
- Institutional Wikis: Populate organizational knowledge bases with converted materials
- Structured Content: Preserve headings, lists, tables, and formatting in wiki markup
- No Manual Rewriting: Automate the translation from Typst syntax to wiki markup
Practical Examples
Example 1: Scientific Article to Wikipedia Draft
Input Typst file (article.typ):
= Black Holes A *black hole* is a region of spacetime where gravity is so strong that nothing can escape. == Types - Stellar black holes - Supermassive black holes - Intermediate black holes == Schwarzschild Radius The radius is given by: $ r_s = (2 G M) / c^2 $
Output MediaWiki file (article.mediawiki):
== Black Holes ==
A '''black hole''' is a region of
spacetime where gravity is so strong
that nothing can escape.
=== Types ===
* Stellar black holes
* Supermassive black holes
* Intermediate black holes
=== Schwarzschild Radius ===
The radius is given by:
<math>r_s = \frac{2GM}{c^2}</math>
[[Category:Astrophysics]]
{{See also|Event horizon}}
Example 2: Course Material to Institutional Wiki
Input Typst file (course.typ):
= Introduction to Algorithms == Sorting Algorithms + Bubble Sort: $O(n^2)$ + Merge Sort: $O(n log n)$ + Quick Sort: $O(n log n)$ average == Comparison #table( columns: 3, [Algorithm], [Best], [Worst], [Bubble], [$O(n)$], [$O(n^2)$], [Merge], [$O(n log n)$], [$O(n log n)$], [Quick], [$O(n log n)$], [$O(n^2)$], )
Output MediaWiki file (course.mediawiki):
== Introduction to Algorithms ==
=== Sorting Algorithms ===
# Bubble Sort: <math>O(n^2)</math>
# Merge Sort: <math>O(n \log n)</math>
# Quick Sort: <math>O(n \log n)</math> average
=== Comparison ===
{| class="wikitable"
|-
! Algorithm !! Best !! Worst
|-
| Bubble || <math>O(n)</math> || <math>O(n^2)</math>
|-
| Merge || <math>O(n \log n)</math> || <math>O(n \log n)</math>
|-
| Quick || <math>O(n \log n)</math> || <math>O(n^2)</math>
|}
Example 3: Technical Summary for Knowledge Base
Input Typst file (summary.typ):
= CRISPR Gene Editing == Overview *CRISPR-Cas9* is a molecular tool for editing DNA sequences with unprecedented _precision_. == Applications - Disease treatment - Agricultural improvement - Basic research - Drug development == Mechanism The guide RNA directs Cas9 to the target DNA, where it creates a double-strand break for editing.
Output MediaWiki file (summary.mediawiki):
== CRISPR Gene Editing == === Overview === '''CRISPR-Cas9''' is a molecular tool for editing DNA sequences with unprecedented ''precision''. === Applications === * Disease treatment * Agricultural improvement * Basic research * Drug development === Mechanism === The guide RNA directs Cas9 to the target DNA, where it creates a double-strand break for editing.
Frequently Asked Questions (FAQ)
Q: What is MediaWiki markup?
A: MediaWiki markup is the formatting language used by Wikipedia and thousands of other wiki sites. It uses readable syntax like == for headings, ''' for bold, '' for italic, * for bullet lists, and # for numbered lists. It also supports complex tables, templates, categories, and internal/external linking.
Q: Are Typst math equations preserved in MediaWiki output?
A: Yes, Typst math expressions are converted to LaTeX notation wrapped in <math> tags, which MediaWiki renders using its built-in math rendering engine. This means formulas, fractions, summations, and integrals display correctly on Wikipedia and other MediaWiki installations.
Q: Can I directly paste the output into Wikipedia?
A: The converted markup can serve as a starting point for Wikipedia articles. However, Wikipedia has specific guidelines for formatting, sourcing, and neutral point of view. You will need to adapt the content to meet Wikipedia's Manual of Style, add reliable sources with citation templates, and ensure the content meets notability guidelines.
Q: How are Typst tables converted to MediaWiki tables?
A: Typst's #table() function is converted to MediaWiki's pipe-based table syntax with the "wikitable" CSS class. Column headers use !! separators and data rows use || separators. Basic alignment is preserved. Complex Typst table features may be simplified since MediaWiki tables have different styling capabilities.
Q: Can I use this for Fandom or other MediaWiki-based wikis?
A: Yes! The output markup is compatible with any site running MediaWiki software, including Fandom, Miraheze, ShoutWiki, and self-hosted MediaWiki installations. The core wiki markup syntax is the same across all MediaWiki instances. Some advanced templates may be specific to Wikipedia, but basic formatting works universally.
Q: What happens to Typst's scripting constructs?
A: Typst scripting (#let, #if, #for) is resolved during conversion, so the MediaWiki output contains the final rendered text content. Variable definitions are expanded, conditionals are resolved, and loops produce their iterated output. MediaWiki has its own template system for dynamic content.
Q: How does Typst's = heading syntax map to MediaWiki?
A: Typst's = maps to MediaWiki's == == (level 2 heading), == maps to === === (level 3), and so on. This offset occurs because MediaWiki's = = (level 1) is reserved for the page title. The heading hierarchy is preserved correctly in the conversion.
Q: What about Typst figures and images?
A: Typst's #image() and #figure() constructs are converted to MediaWiki file syntax ([[File:name.ext|caption]]). However, the actual image files need to be uploaded separately to the wiki. Captions are preserved in the markup. For wiki publication, images should be uploaded through the wiki's Special:Upload page.