MediaWiki
REL1_19
|
CLI script to easily parse some wikitext. More...
Public Member Functions | |
__construct () | |
Default constructor. | |
execute () | |
Do the actual work. | |
render ($wikitext) | |
Protected Member Functions | |
getTitle () | |
Title object to use for CLI parsing. | |
initParser () | |
parse ($wikitext) | |
Wikitext () | |
Get wikitext from a the file passed as argument or STDIN. | |
Protected Attributes | |
$parser |
CLI script to easily parse some wikitext.
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:
Example3:
$ cat /tmp/foo | php parse.php <p><b>bold</b> </p>$
Default constructor.
Children should call this *first* if implementing their own constructors
Reimplemented from Maintenance.
Definition at line 39 of file parse.php.
References Maintenance\addArg(), and Maintenance\addOption().
Do the actual work.
All child classes will need to implement this
Reimplemented from Maintenance.
Definition at line 46 of file parse.php.
References initParser(), print, and render().
CLIParser::getTitle | ( | ) | [protected] |
Title object to use for CLI parsing.
Default title is 'CLIParser', it can be overriden with the option --title <Your:Title>
Definition at line 88 of file parse.php.
References $title, Maintenance\getOption(), and Title\newFromText().
Referenced by parse().
CLIParser::initParser | ( | ) | [protected] |
Definition at line 75 of file parse.php.
References $wgParserConf.
Referenced by execute().
CLIParser::parse | ( | $ | wikitext | ) | [protected] |
string | $wikitext | Wikitext to parse |
Definition at line 100 of file parse.php.
References getTitle().
Referenced by render().
CLIParser::render | ( | $ | wikitext | ) |
CLIParser::Wikitext | ( | ) | [protected] |
Get wikitext from a the file passed as argument or STDIN.
Definition at line 63 of file parse.php.
References Maintenance\error(), and Maintenance\getArg().