Extension:Wiki2LaTeX/Documentation/Extending Wiki2LaTeX
From MediaWiki.org
[edit] Example: Adding an Option to the Export-Form
This example is taken from contrib/microtype.php
// Adding some functions to some hooks $wgHooks['w2lFormOptions'][] = 'w2lMicrotypeForm'; $wgHooks['w2lFinish'][] = 'w2lMicrotypeHook'; $wgHooks['w2lRegisterOptions'][] = 'w2lMicrotype'; function w2lMicrotype(&$core) { // This line adds our parameter to the parser... $core->addParserParameter('use_microtype'); return true; } function w2lMicrotypeHook( &$parser, &$text ) { if ( $parser->getVal('use_microtype') ) { // Add a packagedependancy so that the auto-template // can load this package. $parser->addPackageDependency('microtype'); } return true; } function w2lMicrotypeForm( &$core, &$output ) { // Adding a checkbox to the export-form. $output .= '<label><input type="checkbox" name="use_microtype" value="true" /> '; $output .= 'Use Microtype</label><br />'."\n"; return true; }