Reencoding MediaWiki pages: Difference between revisions

imported>Cov
No edit summary
imported>Cov
No edit summary
Line 35: Line 35:


=Running=
=Running=
The following command will create .wikitext files of the HTML files for your cut and paste convenience.
==One-Shot==
Replace <code>input.html</code> and <code>out.wikitext</code> with appropriate filenames.
<pre>
<pre>
for f in *.html ; do $( sed -rn -e '/<!-- start content -->/,/<!--/p' $f | sed -r -f script > $f.wikitext ) ; done
sed -rn -e '/<!-- start content -->/,/<!--/p' input.html | sed -r -f script > out.wikitext
</pre>
 
==Batch==
The following command will create .wikitext files of all the HTML files in the current directory for your cut and paste convenience.
<pre>
for f in *.html ; do $( sed -rn -e '/<!-- start content -->/,/<!--/p' "$f" | sed -r -f script > "$f.wikitext" ) ; done
</pre>
</pre>