Sandbox
This page is for editing experiments. Content added here will not stay !Headline
- one
- two
- threeBold text
- indentLink title
!! more
WikiWord
--209.150.52.216 04:10, 16 Dec 2004 (UTC) [[[[math:\alpha^2+\beta^2=1]]]]
Content added below this line stays permanently
<tagname> some text </tagname>
<?php
- Example WikiMedia extension
- with WikiMedia's extension mechanism it is possible to define
- new tags of the form
- <TAGNAME> some text </TAGNAME>
- the function registered by the extension gets the text between the
- tags as input and can transform it into arbitrary HTML code.
- Note: The output is not interpreted as WikiText but directly
- included in the HTML output. So Wiki markup is not supported.
- To activate the extension, include it from your LocalSettings.php
- with: include("extensions/ExampleExt.php");
$wgExtensionFunctions[] = "wfExampleExtension";
function wfExampleExtension() {
global $wgParser; // register the extension with the WikiText parser // the first parameter is the name of the new tag. In this case it defines the tag <example> ... </example> // the second parameter is the callback function for processing the text between the tags $wgParser->setHook( "example", "renderExample" );
}
// The callback function for converting the input text to HTML output function renderExample( $input ) {
$output = "
Text passed into example extension: <br>". $input. "
";
return $output;
} ?>