script to parse wikitext from CLI
authorAntoine Musso <hashar@users.mediawiki.org>
Wed, 26 Oct 2011 13:39:43 +0000 (13:39 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Wed, 26 Oct 2011 13:39:43 +0000 (13:39 +0000)
commitfb4aac95dd778db75a1ef8e73dc560cfc9025904
tree44998145a398fe5122be848f45c0aac056a80378
parent44ff769519fb945f31e6674e80b395cbe37617fb
script to parse wikitext from CLI

Wikitext can be given by stdin or using a file. The wikitext will be parsed
using 'CLIParser' as a title. This can be overriden with --title option.

Example1:

$ php parse.php --title foo
''[[foo]]''^D
<p><i><strong class="selflink">foo</strong></i>
</p>

Example2:

$ echo "'''bold'''" > /tmp/foo
$ php parse.php --file /tmp/foo
<p><b>bold</b>
</p>$

Example3:
$ cat /tmp/foo | php parse.php
<p><b>bold</b>
</p>$
maintenance/parse.php [new file with mode: 0644]