Figlet Extension

Integrate figlet text into wiki pages using figletlink in a custom Mediawiki extension:

this is a first untestedversion with justmonkey knolage of how to make it work

Syntax
text

Example
moo

example Result

 * '_ ` _ \ / _ \ / _ \
 * | | | | | (_) | (_) |
 * _| |_| |_|\___/ \___/

(not installed on anything this is only beta i dont have figlet installed on this server)

Source
setHook( "figlet", "renderFiglet" ); }
 * 1) extension hook callback function

function renderFiglet( $input ) { global $wgOutputEncoding; # $input = mysql_escape_string($input); if (!$input) $input = "mu"; #ifno input then mu

$input =~ /[Aa-Zz]|[1-0];
 * 1) $input = mysql_escape_string($input);
 * 2) $figlet = passthru('echo $input | /home/drowl/figlet/figlet -d /home/drowl/figlet/fonts');


 * 1) $figlet = passthru("figlet moo");
 * 2) just "figlet moo" works on the shell, so you can save the echo and pipe.
 * 3) But the problem with passthru is that we always only get the first line of the returned text.
 * 4) I am being told: <+jome> #mutante: php.net/exec AND
 * 5) mutante: if you fetch stdout lik ethis $foo = `system command`;
 * 6) then foo will be a string with the output of the command.


 * 1) Tested out a bit, and this should work. mutante. (not yet)...

$output="  "; $output.=system ("figlet $input"); $output.=" &gt;/pre> ";

return $output;

}

?>

not installed yet, see ongoing talk.