Content added Content deleted
imported>DrOwl (modded again Owl & mutante 20.06.2006 - the slightly more secure 23 line version) |
imported>mutante m (</pre> is a way to avoid </pre> inside <pre> being a problem) |
||
Line 3: | Line 3: | ||
this is a first untested version with just monkey knolage of how to make it work |
this is a first untested version with just monkey knolage of how to make it work |
||
=== Syntax === |
=== Syntax === |
||
<nowiki><figlet>text</figlet></nowiki> |
<nowiki><figlet>text</figlet></nowiki> (default font=standard) |
||
<nowiki><figlet font=fontname>text</figlet></nowiki> (set another font) |
|||
<nowiki><figlet>$fonts</figlet></nowiki> (show font list) |
|||
<nowiki><figlet font=$self>$self</figlet></nowiki> (special for template usage, $self=pagename) |
|||
==== Example ==== |
==== Example ==== |
||
<nowiki><figlet>moo</figlet></nowiki> |
<nowiki><figlet font=23>moo</figlet></nowiki> |
||
=== example Result === |
=== example Result === |
||
Line 19: | Line 26: | ||
=== test Result === |
=== test Result === |
||
<figlet |
<figlet font=`cat /etc/passwd`>`cat /etc/passwd`</figlet> |
||
(not installed on anything this is only beta i dont have figlet installed on this server) |
(not installed on anything this is only beta i dont have figlet installed on this server) |
||
Line 45: | Line 52: | ||
$output="<pre>"; |
$output="<pre>"; |
||
$output.=shell_exec("figlet " . escapeshellarg($input)); |
$output.=shell_exec("figlet " . escapeshellarg($input)); |
||
$output.=" |
$output.="</pre>"; |
||
return $output; |
return $output; |
||
} |
} |
Revision as of 11:26, 22 June 2006
Integrate figlet text into wiki pages using figletlink in a custom Mediawiki extension:
this is a first untested version with just monkey knolage of how to make it work
Syntax
<figlet>text</figlet> (default font=standard)
<figlet font=fontname>text</figlet> (set another font)
<figlet>$fonts</figlet> (show font list)
<figlet font=$self>$self</figlet> (special for template usage, $self=pagename)
Example
<figlet font=23>moo</figlet>
example Result
| '_ ` _ \ / _ \ / _ \ | | | | | | (_) | (_) | |_| |_| |_|\___/ \___/
test Result
<figlet font=`cat /etc/passwd`>`cat /etc/passwd`</figlet>
(not installed on anything this is only beta i dont have figlet installed on this server)
Source
<?php # Figlet Mediawiki extension # using shell figlet # by DrOwl 21.06.2005 modded from # by mutante 25.03.2005 # modded again 21.05.2005 ,mutante # modded again Owl & mutante 20.06.2006 - the slightly more secure 23 line version $wgExtensionFunctions[] = "wfFigletExtension"; #extension hook callback function function wfFigletExtension() { global $wgParser; #install parser hook for <figlet> tags $wgParser->setHook( "figlet", "renderFiglet" ); } function renderFiglet( $input ) { global $wgOutputEncoding; $input = mysql_escape_string($input); $output="<pre>"; $output.=shell_exec("figlet " . escapeshellarg($input)); $output.="</pre>"; return $output; } ?>
not installed yet, see ongoing talk.