Syntax highlighting

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 2650 Views - Last Post: 12 August 2007 - 10:04 AM

#1 Xing   User is offline

  • D.I.C Addict
  • member icon

Reputation: 19
  • View blog
  • Posts: 725
  • Joined: 22-July 06

Syntax highlighting

Posted 06 January 2007 - 11:10 PM

It would be nice if there would be some kind of syntax highlighting in codes. Is there any option for that?

This post has been edited by Xing: 06 January 2007 - 11:10 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Syntax highlighting

#2 William_Wilson   User is offline

  • lost in compilation
  • member icon

Reputation: 207
  • View blog
  • Posts: 4,812
  • Joined: 23-December 05

Re: Syntax highlighting

Posted 06 January 2007 - 11:14 PM

what do you mean highlighting? at the top in the address bar, type the word you want to highlight after the hl= and it will be highlighted:
highlight a word here


http://www.dreaminco...h...691&hl=here
this line would display this topic, and highlight all occurances of the word here, in or out of code tags.
Was This Post Helpful? 0
  • +
  • -

#3 Xing   User is offline

  • D.I.C Addict
  • member icon

Reputation: 19
  • View blog
  • Posts: 725
  • Joined: 22-July 06

Re: Syntax highlighting

Posted 07 January 2007 - 07:56 PM

WW, I mean the highlighting the way it is in code snippets.
Was This Post Helpful? 0
  • +
  • -

#4 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1981
  • View blog
  • Posts: 20,434
  • Joined: 17-March 01

Re: Syntax highlighting

Posted 07 January 2007 - 09:00 PM

Yeh, I've tried coding it myself, didn't have much luck. And I'm not a fan of "mods" for forums as they just break when you upgrade. So... unless the new version of IPB has it, then it's probably not gonna happen any time soon :( sorry Xing. It's something I'd really like too.
Was This Post Helpful? 0
  • +
  • -

#5 born2c0de   User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 187
  • View blog
  • Posts: 4,673
  • Joined: 26-November 04

Re: Syntax highlighting

Posted 07 January 2007 - 09:20 PM

But there is no problem as such.
I'm pretty content with the code tags.
If there's a lot of code to look at, I just copy-paste it into my compiler's IDE.
I'm pretty sure everyone else does that for large amounts of code too.

But yeah, Syntax Highlighting will be useful for reading shorter code.
Was This Post Helpful? 0
  • +
  • -

#6 Xing   User is offline

  • D.I.C Addict
  • member icon

Reputation: 19
  • View blog
  • Posts: 725
  • Joined: 22-July 06

Re: Syntax highlighting

Posted 07 January 2007 - 09:59 PM

View Postborn2c0de, on 8 Jan, 2007 - 09:50 AM, said:

But there is no problem as such.
I'm pretty content with the code tags.
If there's a lot of code to look at, I just copy-paste it into my compiler's IDE.
I'm pretty sure everyone else does that for large amounts of code too.

But yeah, Syntax Highlighting will be useful for reading shorter code.

Most of the time I just look the code and reply. rarely I compile and check. Most of the problems can be found by dry run. Highlighting does help me understand faster.
Was This Post Helpful? 0
  • +
  • -

#7 eLliDKraM   User is offline

  • Pepè Le Pewn
  • member icon

Reputation: 7
  • View blog
  • Posts: 6,565
  • Joined: 13-August 05

Re: Syntax highlighting

Posted 07 January 2007 - 10:33 PM

when i used to help people i would just paste it into my compiler.
we should have an inter-site compiler while we're at it...
Was This Post Helpful? 0
  • +
  • -

#8 born2c0de   User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 187
  • View blog
  • Posts: 4,673
  • Joined: 26-November 04

Re: Syntax highlighting

Posted 09 January 2007 - 03:24 AM

View PostXing, on 8 Jan, 2007 - 10:29 AM, said:

Most of the time I just look the code and reply. rarely I compile and check. Most of the problems can be found by dry run. Highlighting does help me understand faster.

If you do that for long code, you really have a lot of free time ;)


Quote

when i used to help people ...
lol...
Was This Post Helpful? 0
  • +
  • -

#9 Xing   User is offline

  • D.I.C Addict
  • member icon

Reputation: 19
  • View blog
  • Posts: 725
  • Joined: 22-July 06

Re: Syntax highlighting

Posted 09 January 2007 - 04:30 AM

View Postborn2c0de, on 9 Jan, 2007 - 03:54 PM, said:

If you do that for long code, you really have a lot of free time ;)

Actually, it's the other way around. Because of lack of time I just dry scan the code.
Was This Post Helpful? 0
  • +
  • -

#10 Programmist   User is offline

  • Refactorer in Chief
  • member icon

Reputation: 256
  • View blog
  • Posts: 1,843
  • Joined: 02-January 06

Re: Syntax highlighting

Posted 13 April 2007 - 08:19 AM

I'm bumping this because a new version of IPB is out. :) I was just thinking how nice it would be if we had syntax highlighting and formatting code tags for Java, but then new people rarely use them. And sometimes, even when they do, there's no indenting, or they've one-lined a lot of stuff so it runs past the code window. Maybe I could write a parser that takes syntactically valid Java code, in any form, strips all spaces and line breaks, and outputs formatted, indented, and colored BBCode. Yeah...'cause I have time for that. :) I'll put it on my project stack.
Was This Post Helpful? 0
  • +
  • -

#11 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1981
  • View blog
  • Posts: 20,434
  • Joined: 17-March 01

Re: Syntax highlighting

Posted 13 April 2007 - 08:22 AM

Someone here wrote a VB app that would actually syntax highlight code using BBCode.

I do have plans to upgrade IPB, but I'm waiting for one more update before I start the process.

Not sure if it has syntax highlighting, but I doubt it.

I probably said it in this thread already, but I don't like adding mods and such to IPB because it makes it very difficult to upgrade and I don't have the time to re-code someone elses mod to work with a new version.
Was This Post Helpful? 0
  • +
  • -

#12 Programmist   User is offline

  • Refactorer in Chief
  • member icon

Reputation: 256
  • View blog
  • Posts: 1,843
  • Joined: 02-January 06

Re: Syntax highlighting

Posted 13 April 2007 - 11:34 AM

View Postskyhawk133, on 13 Apr, 2007 - 08:22 AM, said:

Someone here wrote a VB app that would actually syntax highlight code using BBCode.

I do have plans to upgrade IPB, but I'm waiting for one more update before I start the process.

Not sure if it has syntax highlighting, but I doubt it.

I probably said it in this thread already, but I don't like adding mods and such to IPB because it makes it very difficult to upgrade and I don't have the time to re-code someone elses mod to work with a new version.

I can definitely understand that. It might be a good project for me to undertake for academic purposes anyway. Might helpe me get a stronger grasp of context-free grammars and all that. We'll see. :)
Was This Post Helpful? 0
  • +
  • -

#13 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Syntax highlighting

Posted 24 April 2007 - 04:21 PM

The big problem with doing syntax hilighting in BBCode is the lack of a nonbreaking space like   in html. You can hilight, you can even use a font tag to get a fixed width font (heck you have a choice), but you can't use any kind of formating. One work arround is the use of White Colored Text, but this mean that when someone tries to copy your code to try it out, they have to remove all the little spacers you used for formatting. I guess you might be able to use the IMG tag... just thought of that. The [indent] tag does not work.

See this should be indented... but its not


one interesting point about using the string " " is that when you hit "preview post" you will see " " in your post preview, but NOT in your edit box. When you preview again the string is gone. But sadly it does not replace it with a non breaking space.
Was This Post Helpful? 0
  • +
  • -

#14 ajaymatrix   User is offline

  • D.I.C Regular
  • member icon

Reputation: 1
  • View blog
  • Posts: 410
  • Joined: 15-May 07

Re: Syntax highlighting

Posted 16 June 2007 - 11:34 PM

GeSHi - Generic Syntax Highlighter

It is for phpBB forum system but some tweaking may make it run on this forum also.I am not sure..
If you get time try that out...
Was This Post Helpful? 0
  • +
  • -

#15 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1981
  • View blog
  • Posts: 20,434
  • Joined: 17-March 01

Re: Syntax highlighting

Posted 17 June 2007 - 08:38 AM

That's what we use in Code Snippets, I've tried repeatedly to get it working in the forums and there's something about how posts are parsed that makes it damn near impossible it seems.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2