This help page is ahow-to guide. It explains concepts or processes used by the Wikipedia community. It is not one ofWikipedia's policies or guidelines, and may reflect varying levels ofconsensus. |
There are various methods to transfer content from word processor software into MediaWiki format as used on Wikipedia.
VisualEditor allows for the copying/pasting of content from Word documents directly into a wiki page. Most formatting is kept intact – including tables. However, images and advanced formatting may need to be cleaned up upon import. This can also be used to acquire formatting for other programs that require plaintext (simply don't save the conversion and instead copy it from the editor and paste it wherever desired; aSandbox is recommended for this).
VisualEditor allows for the copying/pasting of content from Word documents directly into a wiki page. Most formatting is kept intact – including tables. However, images and advanced formatting may need to be cleaned up upon import. This can also be used to acquire formatting for other programs that require plaintext (simply don't save the conversion and instead copy it from the editor and paste it wherever desired; aSandbox is recommended for this).
You can extract contents of adocx word file by simply naming it azip file (docx is a compressed archive). Once you have a zip file, you can open the archive and have a complete folder of the original images used in the document. See this short YouTube video:https://www.youtube.com/watch?v=OdhSJJqdK6s
The following Visual Basic macros from 2007, unmaintained as of 2017, may still work:Word2MediaWikiPlusTested with Office 365 word, conversion works despite getting a warning several times. NOTE: This will (apparently?) only work with 32-bit Office installations
Note that the web page where the source file for his can be downloaded as at 20240807 states "This extension has been archived. This extension has not been maintained for some time, and no longer supports recent releases of MediaWiki."
Download from:https://sourceforge.net/projects/word2mediawikip/
Microsoft released an add-in that allows you to save your Microsoft Office Word 2007 or above documents straight into MediaWiki.
Note that this extension does not work for Word 2013 by default, however it can be made to work with a registry change. Seethis page.
Nevertheless, for those who are unfamiliar withMediaWiki Markup Language and who are working on simple articles, theMicrosoft Office Word Add-in For MediaWiki can be a useful tool.
The following methods both perform: Word → HTML → MediaWiki.
The conversion can also be done using a combination of two scripts and two software packages.
AbiWord --to=html instead. AbiWord can be obtained atabisource.com.)> doc2mw my_word.doc
#!/bin/bash# doc2mw - Word to MediaWiki converterFILE=$1TMP="$$-${FILE}"if[-x"./html2mw"];thenHTML2MW='./html2mw'elseHTML2MW='html2mw'fiwvHtml--targetdir=/tmp"${FILE}""${TMP}"# but see also AbiWord: http://www.abisource.com/help/en-US/howto/howtoexporthtml.html# Remove extra divsperl-pi-e"s/\<div[^\>]+.\>//gi;""/tmp/${TMP}"${HTML2MW}"/tmp/${TMP}"rm"/tmp/${TMP}"
#!/usr/bin/perl# html2mw - HTML to MediaWiki converteruseHTML::WikiConverter;my$b;while(<>){$b.=$_;}my$w=newHTML::WikiConverter(dialect=>'MediaWiki');my$p=$w->html2wiki($b);# Substitutions to get rid of nasty things we don't need$p=~s/<br \/>//g;$p=~s/\ \;//g;print$p;
Disclaimer: These scripts are probably not the best way to do this, only apossible way to do this. Please feel free to improve them.
LibreOfficeWriter can save Word documents directly to wikitext: go to File → Export → Save as type: Mediawiki. (For Linux users it may be necessary to install the librarylibreoffice-wiki-publisher). Alternatively, use the command-line utility like this:
soffice--headless--convert-totxt:MediaWikimydocument.doc
OpenOffice versions 3.3 and later can send documents in formats it supports (including Microsoft Word) directly to a MediaWiki, but this does not seem to work under Windows 7. (At least for the German version ofOpenOffice 3.3.0 you need to install the ‘Sun Wiki Publisher’-extension first! Server url:http://en.wikipedia.org/w/ )Once you have added the MediaWiki-server of your choice, future submissions can happen automatically.
Alternatively the manual 'export-function' can be used: File → Export → choose ‘MediaWiki (.txt)’-format. LibreOffice Writer 5 can export as a MediaWiki .txt file under Windows 10 if the appropriate 32- or 64-bitJava Runtime Environment (JRE) has been installed and enabled in LO. The document to be converted has to use styles, etc.; for example headers must be in Heading 2 style to be bracketed by "==" when converted.
Pandoc is a command-line utility that can convert from and to many document formats. Once installed, converting from Word to Mediawiki looks like this:
$pandoc-tmediawikimydocument.docx>mydocument.wiki
See also theonline Pandoc tool which can convert an HTML-export of the Word document to MediaWiki format.