I'm trying to write a command line mediawiki markup parser that
doesn't require a full Mediawiki setup/installation with database etc.

So far I have this below which works pretty good but requires that my
Mediawiki installation be set up with a database.

How can I remove the database dependency from this script?

Also, the article links generated are in the format
/index?title=Article_Title&action=edit&redlink=1   how can I change
the formatting of these parameters so that it's just  /Article_Title

Thanks,

Jonathan


<?php

require_once dirname( __FILE__ ) . '/maintenance/commandLine.inc';

$text = "* [[foo]]\n* [[Example|bar]]\n* [http://example.com/ an outside link]";

$titleObj = Title::newFromText( 'Example' );
$parserOptions = new ParserOptions();
$parserOptions->setTidy( true );
$parserOptions->setEditSection( false );

$parserOutput = $wgParser->parse( $text, $titleObj, $parserOptions );
$parsedText = $parserOutput->getText();

echo $parsedText;

?>

_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to