Migrating a Google Doc into MediaWiki: Difference between revisions
Created page with "'''Question:''' Should I copy and paste a Google Doc into the wiki editor, or download it in a specific format first? '''Answer:''' Copy-paste brings along Google's inline styling as messy HTML/CSS that the MediaWiki editor will either choke on or render literally. It's cleaner to download the doc and convert it with a dedicated tool. === Recommended workflow: Download as .docx, convert with pandoc === <syntaxhighlight lang="bash"> pandoc -f docx -t mediawiki --extrac..." |
mNo edit summary |
||
| Line 26: | Line 26: | ||
[[Category:Wiki Administration]] | [[Category:Wiki Administration]] | ||
[[Category: | [[Category:How-To]] | ||
Latest revision as of 20:40, 14 August 2026
Question: Should I copy and paste a Google Doc into the wiki editor, or download it in a specific format first?
Answer: Copy-paste brings along Google's inline styling as messy HTML/CSS that the MediaWiki editor will either choke on or render literally. It's cleaner to download the doc and convert it with a dedicated tool.
Recommended workflow: Download as .docx, convert with pandoc
pandoc -f docx -t mediawiki --extract-media=./images -o article.wiki mydoc.docx
Pandoc's MediaWiki writer handles headings, bold/italic, bullet and numbered lists, tables, and internal links cleanly. The --extract-media flag pulls embedded images into a folder so they don't need to be re-sourced separately.
Steps after conversion:
- Open
article.wikiand skim it — pandoc is good but not perfect, so check tables and nested lists especially. - Paste the wikitext into the MediaWiki edit box.
- Upload the extracted images separately via
Special:Upload(orphp maintenance/importImages.phpfor batches), and fix upFile:...references, since pandoc's image syntax sometimes needs a tweak to match MediaWiki's expected format.
Why .docx over other export formats
- HTML export also works with pandoc (
-f html) and is arguably cleaner for text since it skips OOXML overhead, but Google's HTML export bundles images as a zip with separate numbered files — an extra unzip step compared to docx +--extract-media. - Markdown export (now offered by Google Docs) sounds convenient but tends to flatten structure — especially tables and footnotes — worse than docx does through pandoc's OOXML parser.
- .odt / .rtf — skip these; no real advantage over docx for this pipeline.
Offer: Paste the resulting article.wiki content here for a cleanup pass — fixing heading levels, converting leftover HTML artifacts to wikitext, adding categories, etc. — before publishing.