Author Topic: Proposal: Colouration for code ?  (Read 4787 times)

0 Members and 1 Guest are viewing this topic.

Offline LittleWhite

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 418
  • Karma: 31
  • It's me!
    • View Profile
Proposal: Colouration for code ?
« on: May 21, 2011 »
Hello,

As we are a coder forum, why our code in the [ code ] [ /code ] is not syntaxicly coloured ?
It would be cool if it could be added. I hope it's not too much work on this architecture ... :) ... moreover since we are handling multiple langages.

Code: [Select]
int main()
{

    printf("This is a test\n");
    return 0;
}
The demoscene will never die, never!

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Proposal: Colouration for code ?
« Reply #1 on: May 21, 2011 »
It's a nice idea but as far as I know there are no SMF modifications out there for RC5 that do this (If you know of a freely available modification that does this please let me know) and it would actually be a huge amount of work to code our own.

I'd suggest instead that you copy and paste the code you want to look more closely at into notepad++ which is free and does a great job of colour coding sources.


Shockwave ^ Codigos
Challenge Trophies Won:

Offline LittleWhite

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 418
  • Karma: 31
  • It's me!
    • View Profile
Re: Proposal: Colouration for code ?
« Reply #2 on: May 21, 2011 »
It's a nice idea but as far as I know there are no SMF modifications out there for RC5 that do this (If you know of a freely available modification that does this please let me know) and it would actually be a huge amount of work to code our own.

I'd suggest instead that you copy and paste the code you want to look more closely at into notepad++ which is free and does a great job of colour coding sources.
Ok, ... I don't know anything on SMF, so I will trust you the eyes closed :) (I don't know how to say it properly :D)

And, yes, I was thinking about the same workaround ... :) so I will do next time ;)
The demoscene will never die, never!

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Proposal: Colouration for code ?
« Reply #3 on: May 21, 2011 »
Thanks for suggesting the idea though :) K+

I try and impliment as many of them as I can.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline LittleWhite

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 418
  • Karma: 31
  • It's me!
    • View Profile
Re: Proposal: Colouration for code ?
« Reply #4 on: May 21, 2011 »
Thanks for suggesting the idea though :) K+

I try and impliment as many of them as I can.
If you need help, maybe we can work together :) (As I think to know better the C langage ; and I know forums using some colourations scheme :) )
The demoscene will never die, never!

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Proposal: Colouration for code ?
« Reply #5 on: May 21, 2011 »
Sorry, you mis-understood - I was thanking you for suggeting the idea and letting people know that ideas are welcome - I alwys do my best to impliment peoples suggestions where possible but this one is very difficult.

As for this one, as nice as it would be I have no plans to impliment it because it will involve too much work and too many modifications to the source - the juice is not worth the squeeze so to speak.

If you can PM me the links to the forums you know are using source colouration that recognises which programming language is being used I will take a look (just to make sure that I am not missing something obvious!)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline LittleWhite

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 418
  • Karma: 31
  • It's me!
    • View Profile
Re: Proposal: Colouration for code ?
« Reply #6 on: May 21, 2011 »
Sorry, you mis-understood - I was thanking you for suggeting the idea and letting people know that ideas are welcome - I alwys do my best to impliment peoples suggestions where possible but this one is very difficult.

As for this one, as nice as it would be I have no plans to impliment it because it will involve too much work and too many modifications to the source - the juice is not worth the squeeze so to speak.

If you can PM me the links to the forums you know are using source colouration that recognises which programming language is being used I will take a look (just to make sure that I am not missing something obvious!)
oops (will PM the forum which implements it :))
The demoscene will never die, never!

Offline JL235

  • C= 64
  • **
  • Posts: 71
  • Karma: 9
    • View Profile
    • Play My Code
Re: Proposal: Colouration for code ?
« Reply #7 on: May 23, 2011 »
It's quite trivial to add this (I've done it myself). I used Syntax Highlighter, which is quite popular and does the job very well.

You'll need to alter the tags the code is outputted into (I think syntax highlighter suggests wrapping them in 'pre', but I'm pretty sure I had to use textareas instead), link to the syntax highlighter JS at the bottom of the page, run the syntax highlighting on load and then alter the CSS a little so it fits the dark theme. That's it!
« Last Edit: May 23, 2011 by JL235 »
Play My Code - build games in your browser!

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Proposal: Colouration for code ?
« Reply #8 on: May 23, 2011 »
Cool!

Thanks for that I'll take a look at it and hopefully our code will be more readable soon :)
Shockwave ^ Codigos
Challenge Trophies Won: