Ok so I am writing code tutorials on mysite pretty much documenting things I do and learn, but problem is when I try to insert code it wont let me. It prints the actual code.
tag.
Or you can install the GeSHI markup plugin which deals with syntax highlighting.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Alright I installed the Geshi plugin (unrared and moved the files to /plugins/ and then installed in event.
So in my entry I type
[geshi]
<?php
function my_menu($params, &$smarty) {
$out = '<ul class="sitesections">';
$items = array("Home" => "index.php", "Filler" => "index.php", "Filler" => "index.php");
foreach($items AS $item => $link) {
$out .= '<li><a href="' . $link . '">' . $item . '</a>';
}
return $out;
}
$serendipity['smarty']->register_function('my_menu', 'my_menu');
?>
[/geshi]
and nothing.
if I put [geshi lang=php] it works, but [geshi lang=php ln=1] wont. It seems extremely tempermental. It also hates quotes and some other nonsense.
I am looking for documentation on the proper syntax of using geshi I even visited the authors website and found no such documentation. If someone could point me in the right direction id be in your debt. Thanks!
If you're going to all that much effort to insert a code snippet, why don't you just use the regular editor without geshi and simply place a manual <code></code> around your snippet. Then if you're not happy with the way code snippets are displayed, simply edit or add code {} to your template's stylesheet.
This approach has the advantage of one less plugin installed (every additional plugin affects performance), and means that if you ever need to copy and paste your entry to another site the html is already there and doesn't need to be converted from geshi.
The display isnt outputting all the text between the two tags its thinking its real code, I dont want it embeded as code in the page I want it as plain text.