mwstake / mediawiki-component-wikitext
Provides wikitext handling and tree parsing
Installs: 14 914
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 1
Requires
Requires (Dev)
- jakub-onderka/php-console-highlighter: 0.4.0
- jakub-onderka/php-parallel-lint: 1.0.0
- mediawiki/mediawiki-codesniffer: 29.0.0
- mediawiki/minus-x: 1.0.0
- phpunit/phpunit: ^8.5
README
WikiText for MediaWiki
This code is meant to be executed within the MediaWiki application context. No standalone usage is intended.
Use in a MediaWiki extension
MediaWiki 1.35
- Add
"mwstake/mediawiki-component-wikitext": "~5"
to therequire
section of yourcomposer.json
file.
MediaWiki 1.39
- Add
"mwstake/mediawiki-component-wikitext": "~6"
to therequire
section of yourcomposer.json
file.
Since 2.0 explicit initialization is required. This can be achived by
- either adding
"callback": "mwsInitComponents"
to yourextension.json
/skin.json
- or calling
mwsInitComponents();
within you extensions/skins customcallback
method
See also mwstake/mediawiki-componentloader
.
Available Services
MWStakeWikitextParserFactory
MWStakeWikitextNodeProcessorRegistryFactory
Using the MenuParser
/* @var MediaWiki\Revision\RevisionRecord */ $revision = $this->getRevision(); /* @var MWStake\MediaWiki\Component\Wikitext\ParserFactory */ $parserFactory = MediaWiki\MediaWikiServices::getInstance()->get( 'MWStakeWikitextParserFactory' ); /* @var MWStake\MediaWiki\Component\Wikitext\Parser\MenuParser */ $menuParser = $parserFactory->newMenuParser( $revision ); /* @var MWStake\MediaWiki\Component\Wikitext\INode[] */ $nodes = $parser->parse();