1 (edited by Xeoncross 2007-01-02 23:12)

Topic: Code Highlighter v1

Hello everyone!

I just wrote a MOD for punBB and other than needing some cosmetic finishes (i.e. not punBB MOD Template valid) it works fine on my system. So.....

Who wants to give it a spin? tongue

Only four steps to install, supports *most* common languages, and has lots of features! big_smile

PunBB Code Highlighter

Built off of the GeSHi Filter.

Re: Code Highlighter v1

I thought we already had this? Oh well, looks nice enough smile

Re: Code Highlighter v1

what would the code tag look like, would it look like [code=css] or just [css] or something else?

4 (edited by Xeoncross 2007-01-03 00:10)

Re: Code Highlighter v1

Just like regular code you would put a [*code*] (without the *) tag around it.

Then you would place the [nameoflanguage] tag ANYWERE in the code and it would read, then delete it. If no [nameoflanguage] tag is found the processor defaults to PHP. Examples:

PHP:

<HTML>
<HEAD>
<TITLE><?php echo $tile; ?><TITLE>
</HEAD>
<BODY>
<?php echo "Welcome to $sitename"; ?>
<p>We are committed to serving you!</p>
</BODY>
</HTML>
[php]

HTML:

<HTML>
[html]
<HEAD>
<TITLE><?php echo $tile; ?><TITLE>
</HEAD>
<BODY>
<?php echo "Welcome to $sitename"; ?>
<p>We are committed to serving you!</p>
</BODY>
</HTML>

CSS:

[css]
BODY {
line-height: 1.5em;
color: #ccc;
}

Note: you can place the tag anywhere (cool huh?) and there is NO closing tag.

5 (edited by kierownik 2007-01-03 00:17)

Re: Code Highlighter v1

I have it now installed on my website and I have one post where i have multiple code tags with css in them.
but when i only put the [css] tag in the top one the others are also seen as css but they maby are not css!
and so if the second one is just some code it will be coded as css and not normal.

but cool mod smile

6

Re: Code Highlighter v1

Too bad Riklaunim doesn't keep up with his benchmarks.

Nice mod, I like Geshi, I use it in DokuWiki, thanks.

Re: Code Highlighter v1

kierownik wrote:

I have it now installed on my website and I have one post where i have multiple code tags with css in them.
but when i only put the [css] tag in the top one the others are also seen as css but they maby are not css!
and so if the second one is just some code it will be coded as css and not normal.

but cool mod smile

Sorry, I don't understand.

The Mod treats each code block independent. That way you can have multiple CSS, HTML, PHP, VB, ASP, Java, etc.. blocks all in the same post, yet colored differently. Just make sure you put the name of the language in "[****]" somewhere in each code block.

Re: Code Highlighter v1

if i post something like this:
[ code]
blablabla
[/code ]

[ code]
[css]
blablabla
[/code ]

[ code]
blablabla
[/code ]

The first block will be seen as php,
the second wil be seen as css because it has the [css] tag but,
the third block is also seen as css but should be seen as php.

I hope i made it clear now smile roll

9

Re: Code Highlighter v1

I have MOD for highlight code, check it
Multi Syntax Highlight code PunBB 1.2.x 1.1.5
it is use 3 engine (Geshi, FSHL or phpMSH)

the code language passed like as
[ code=php ]
[ / code]

If your people come crazy, you will not need to your mind any more.