<?php
 # To activate the extension, include it from your LocalSettings.php
 # with: include("extensions/bibleExt.php"); 
 $wgExtensionFunctions[] = "wfBibleExtension";
 
 function wfBibleExtension() {
     global $wgParser;
     # register the extension with the WikiText parser
     $wgParser->setHook( "bible", "renderBible" );
 }
 
 # The callback function for converting the input text to HTML output
 function renderBible( $input ) {
      sscanf($input, "%s %d:%d", $book, $chapter,$verse);
      $book=trim($book);
      $book=strtr($book," ","_")
      $output="<a href='http://wikisource.org/wiki/Bible%2C_English%2C_King_James%2C_$book#Chapter_$chapter' title='$input'>$input</a>";
      return $output;
 }
 ?>

