Why I hate [syntax=java]

Discussion in 'Bukkit Project and Community Feedback' started by desht, May 24, 2012.

  1. Offline

    desht

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The "syntax=java" tag is a great idea, in theory. But in practice, not so much - for two reasons:
    1. The muddy-coloured text on a black background does not contrast well, and is much less readable than dark text on a light background. If the background must be black, can we at least have some brighter text? (I appreciate this is subjective, but light text on a dark background = bad, IMHO)
    2. More infuriatingly, any attempt to edit a post which contains "syntax=java" code destroys the indentation of the code, making it pretty much useless for any non-trivial code examples. This doesn't happen with the "php" or "code" tags.
    Any chance the forum admins could take the above under consideration?
    hawkfalcon and fromgate like this.
  2. Offline

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Yeah. It looks bad.
  3. Offline

    ZachBora

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It's actually easier on the eyes to read white text on a black background instead of black text on white background.
    Limeth likes this.
  4. Offline

    pyraetos

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I just hit the code button and paste everything, then erase "code" from the brackets. Seems to preserve indentation.

    Here it is just typing:
    Code:java
    1. PymlConfiguration config = new PymlConfiguration(new File("plugins/MCListID/" + File.separator + "history.yml"));
    2. try{
    3. config.load();


    And here it is the other way:
    Code:java
    1. PymlConfiguration config = new PymlConfiguration(new File("plugins/MCListID/" + File.separator + "history.yml"));
    2. try{
    3. config.load();
  5. Offline

    desht

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Well, as I said: "I appreciate this is subjective". Probably also age-related, and I know that I'm, well.. one of the older posters around here :)

    E.g. http://www.456bereastreet.com/archive/200608/light_text_on_dark_background_vs_readability/

    Of course, the ideal would be to make this easy for users to configure via style sheets.

    In any case, I could put up with the colour scheme. The broken indenting behaviour is a bigger problem.
  6. Offline

    desht

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Testing:
    Code:java
    1.  
    2. public static void main(String[] args) {
    3. System.out.println("Just a test");
    4. for (int i = 0; i < 10; i++) {
    5. System.out.println(i);
    6. }
    7. }
    8.  

    Well that was nicely indented when I posted it, but having edited it, the indentation is gone.

    Could be a browser-related problem; I'm using Chrome.

    This post has been edited 1 time. It was last edited by desht May 24, 2012.
  7. Offline

    pyraetos

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Well yeah editing makes it go jonkers. There's no question it's really a broken system; I was just offering my way of using it. :p
    desht likes this.
  8. Offline

    Sayshal

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I agree with the second, about indentation. But personally, I love the coloring system.
    Pim1234 likes this.
  9. Offline

    TnT Trinitrotoluene Maximus Administrator Bukkit Help

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    This is an issue that would need to be fixed on the Xenforo side. It would require us to change core Xenforo files, which makes maintaining and updating our forums a more complicated process than needed.
  10. Offline

    ZachBora

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I was just stating a fact. Not saying I like the current color scheme. It is indeed hard to read.
    Less light going to your eyes is better. (Books are different as it's indirect light.)

    And that link you provided is also just an opinion, that person gets headaches reading white on black. I did a search myself and yes there is a lot of people complaining about it and they have a point, in their bad example websites.
  11. Online

    ShootToMaim

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Why use "syntax=java" when you can use "code" :D.
    But seriously though. Use code.
  12. Offline

    Sayshal

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I like syntax=java. :)
  13. Online

    ShootToMaim

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Sometimes, when I put it in my long plugin threads, even if I use [/syntax], the code box thing goes on forever. Like... for example, here's an example of a plugin thread:
    BLAHAHAHAHA
    Version: 1.0
    Code:java
    1.  
    2. Trollolololololol
    3.  

    Credits:
    ShootToMaim

    But the problem is, sometimes the syntax box will also include the Credits: and the ShootToMaim part.
  14. Offline

    Technius

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I guess it's time to bug Xenforo about this?
  15. Offline

    imjake9

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I'm using this CSS code to make them look a lot nicer:
    Code:
    pre.java {
        background: none;
        border: none;
    }
     
    pre.java ol {
        margin: 0;
    }
     
    pre.java ol li.li1 {
        color: #666;
        background: none;
    }
     
    pre.java ol li div {
        color: #000;
    }
     
    pre.java ol li div span.kw1 {
        color: #00F;
    }
     
    pre.java ol li div span.kw3 {
        color: #000;
    }
     
    pre.java ol li div span.me1 {
        color: #00A;
    }
     
    pre.java ol li div span.br0 {
        color: #000;
    }
     
    pre.java ol li div span.st0 {
        color: #E90;
    }
     
    pre.java ol li div span.co1 {
        color: #999;
    }
    I insert it using the Chrom extension Stylebot, but I'm sure there's a Firefox equivalent for those of you who use it.
    desht likes this.
  16. Offline

    desht

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Very much better, thanks!
  17. Offline

    codename_B

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Code:
    What's all the big fuss about anyway?
    
    Code:java
    1.  
    2. I much prefer [ code ] tags. End of.

    This post has been edited 2 times. It was last edited by codename_B Jun 16, 2012.
  18. Offline

    ColaCraft

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Code:java
    1. hfeu


    testing ...

    This post has been edited 1 time. It was last edited by ColaCraft Jul 7, 2012.
  19. Offline

    md_5

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Was that really necessary?
    If you are going to post something please try to keep it ontopic.
  20. Offline

    JOPHESTUS

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    What does hfeu mean?
  21. Offline

    ColaCraft

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Lol i was testing the syntax thing... I had no idea how to use it

    This post has been edited 1 time. It was last edited by ColaCraft Jul 7, 2012.
  22. Offline

    Aza24

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    GitHub theme anyone?

    Code:
    pre.java {
        background: #ECECEC;
        border: none;
    }
     
    pre.java ol {
        margin: 0;
    }
     
    pre.java ol li.li1 {
        color: #AAA;
        background: #FFF;
        padding-left: 10px;
    }
     
    pre.java ol li div {
        color: #333;
    }
     
    pre.java ol li div span.kw1 {
        color: #333;
        font-weight: bold;
    }
     
    pre.java ol li div span.kw3 {
        color: #333;
    }
     
    pre.java ol li div span.kw4 {
        color: #458;
        font-weight: bold;
    }
     
    pre.java ol li div span.st0 {
        color: #D14;
    }
     
    pre.java ol li div span.me1, span.nu0 {
        color: teal;
    }
     
    pre.java ol li div span.br0 {
        color: #333;
    }

    This post has been edited 5 times. It was last edited by Aza24 Jul 10, 2012.
    kezz101 likes this.
  23. Offline

    Aza24

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The Stylebot style can now be found here.
    desht likes this.

Share This Page