Reencoding MediaWiki pages: Difference between revisions
imported>Cov No edit summary |
No edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 35: | Line 35: | ||
=Running= | =Running= | ||
==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> | ||