Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Forum Module

Discuss the Forum Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

PHP Syntax Highlighting


Go to End
Reply

9 Posts   2324 Views

Avatar
Carbon Crayon

15 January 2009 at 11:36am (Last edited: 15 January 2009 11:36am), Community Member, 598 Posts

having used the forums a lot lately (and loving the work you guys have done recently!) I think the one thing that makes communicating code that much harder is the lack of syntax highlighting. If we had that it would really bring the support up a level....at least if feels like it would.
How difficult would it be to implement a highlighting script like this one?: http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/

just a though :)

Avatar
ajshort

15 January 2009 at 11:44am (Last edited: 15 January 2009 11:44am), Community Member, 244 Posts

http://au.php.net/highlight-string ;)

Avatar
Willr

15 January 2009 at 12:00pm Forum Moderator, 5511 Posts

Well ideally we shouldn't have large chunks of PHP code on the forum and as it kinda makes posts quite long. Would be good if people all used pastie.org or similar to paste links to their code.

But I will look into adding Syntax highlighting to the BBCode Parser (I thought it had it at one stage)

Avatar
Carbon Crayon

15 January 2009 at 12:06pm Community Member, 598 Posts

I see what your saying about making posts long, I know some of mine have been pretty monstrous. But at the same time sometimes it's definately worth posting a short function or two rather than linking externaly just to keep the post flowing.

I hadn't used pastie before but it looks pretty useful, I will start using it for my longer posts (although I couldnt get the highlighting on that to work either :( )

Avatar
Hamish

15 January 2009 at 2:47pm Community Member, 712 Posts

Also, please please please could white space be preserved in code blocks?

class MyObjects {
function LookReally() {
return array(
"ugly" => true
);
}
}

Avatar
UncleCheese

15 January 2009 at 3:58pm 4085 Posts

Second!!!!

Avatar
UncleCheese

15 January 2009 at 4:00pm 4085 Posts

Has anyone tried the recipe on syntax highlighting in the docs? It's bloody awful. Did not work for me at all.

I use highlight,js, but the HTMLEditor in Silverstripe rips out the code tags for some reason. So it's a huge mess. And getting the indenting right is a massive headache.

Glad we have a dialogue going about this. Important issue.

Avatar
lxer

26 January 2009 at 9:53pm Community Member, 16 Posts

i tried that recipe on syntax highlighting, but it is missing some essential stuff.
I can't get it to work properly

Go to Top