Open main menu

Linux and Unix Users Group at Virginia Teck Wiki β

Changes

Reencoding MediaWiki pages

35 bytes added, 05:31, 9 November 2009
no edit summary
The following script is a work in progress. The end goal is to produce [[w:Wikitext]] from the HTML of a downloaded [[w:MediaWiki]] page.
=Script=
<pre>
sed -rn -e '/<!-- start content -->/,/<!--/p' page.html | \
sed -r -e '/<!--/d' \ -e 's%|</?p>%%||g' \ -e 's%|<br>%|<br />%|' \ -e 's|<a href="([^"]*)" class="external text" title="[^">]*" rel="nofollow">([^<]*)</a>|[\1 \2]|g'
</pre>
 
=Todo=
* Header tags to equal signs
* Local links to article links
Anonymous user