Jump to:

1033 Posts in 809 Topics by 313 members

Forum Module

SilverStripe Forums » Forum Module » PHP Syntax Highlighting

Discuss the Forum Module.

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

Page: 1 2
Go to End
Author Topic: 2270 Views
  • Aram
    Avatar
    Community Member
    598 Posts

    PHP Syntax Highlighting Link to this post

    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

  • ajshort
    Avatar
    Community Member
    244 Posts

    Re: PHP Syntax Highlighting Link to this post

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: PHP Syntax Highlighting Link to this post

    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)

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: PHP Syntax Highlighting Link to this post

    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 )

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: PHP Syntax Highlighting Link to this post

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

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

  • UncleCheese
    Avatar
    4085 Posts

    Re: PHP Syntax Highlighting Link to this post

    Second!!!!

  • UncleCheese
    Avatar
    4085 Posts

    Re: PHP Syntax Highlighting Link to this post

    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.

  • lxer
    Avatar
    Community Member
    16 Posts

    Re: PHP Syntax Highlighting Link to this post

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

    2270 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.