Changes

Jump to: navigation, search

Help:WordToWiki

1,574 bytes added, 05:15, 17 July 2006
correct my overzealous rewording of the WvWare link
Here are some tools that may be helpful in converting Microsoft Word files to wiki markup:

* [[Word2MediaWikiPlus]]: Converts text, tables and pictures into wiki format.
* [http://tikiwiki.org/tiki-index.php?page=WordToWiki_swythan Word to TikiWiki]
* [http://confluence.atlassian.com/display/CONFEXT/Word+to+Confluence+Converter?focusedCommentId=11298 Word to Confluence Converter]

The conversion can also be done using a two step process using Perl. This requires the following software:
* [http://search.cpan.org/~diberri/HTML-WikiConverter-0.55/lib/HTML/WikiConverter.pm HTML::WikiConverter]
* [http://wvware.sourceforge.net/ wvWare Word to HTML(?) converter]

doc2mw:
<pre><nowiki>
#!/bin/bash
# doc2mw - Word to MediaWiki converter

FILE=$1
TMP="$$-${FILE}"

if [ -x "./html2mw" ]; then
HTML2MW='./html2mw'
else
HTML2MW='html2mw'
fi

wvHtml --targetdir=/tmp "${FILE}" "${TMP}"

# Remove extra divs
perl -pi -e "s/\<div[^\>]+.\>//gi;" "/tmp/${TMP}"

${HTML2MW} "/tmp/${TMP}"
rm "/tmp/${TMP}"
</nowiki></pre>

html2mw:
<pre><nowiki>
#!/usr/bin/perl
# html2mw - HTML to MediaWiki converter

use HTML::WikiConverter;

my $b;
while (<>) { $b .= $_; }

my $w = new HTML::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/\&nbsp\;//g;
print $p;
</nowiki></pre>

<i>Disclaimer: These scripts are probably not the best way to do this, only a *possible* way to do this. Please feel free to improve them.</i>
Anonymous user

Navigation menu