This question is captured pretty well by its title, but for more background, on the on StackExchange we have pretty-printing on the code blocks (see here for some more explanation). I believe it is based on the JavaScript mode.

Is this easy to set up for the beta? If so, can we have some tweaks, e.g. to treat (*...*) as comments, not //?

  • 1
    Good point, especially since writing Mathematica in InputForm by default isn't the most readable thing in the first place, and the absence of color doesn't help much there. – David Jan 18 '12 at 4:25
  • Am I really the only one who found the syntax highlighting recently enabled on SO worse than no syntax highlighting at all? It greys out anything postfix, for instance. With no syntax highlighting I could read small expressions, now I just have to paste everything into mma. I don't see how it aided mentally parsing the expression (although it appears I am alone in this). – acl Jan 18 '12 at 14:14

This has been enabled on the main site.

  • Next build or right away? – rm -rf Jan 18 '12 at 23:15
  • Right away. It's based on the tag included or by inline hints: meta.stackexchange.com/q/72082/140548 – Rebecca Chernoff Jan 18 '12 at 23:33
  • The question was more along the lines of "Can we have this enabled across the site, irrespective of tags", since we won't be using specific language tags here and everything is Mathematica. Also, it also asked if some customizations could be made. I don't see any of these on the main site... – rm -rf Jan 18 '12 at 23:58
  • We can set a default across the entire site - but bear in mind that can also make anything else in a code block ugly. That's something the community needs to decide. We simply pull in Google Prettify as Szabolcs mentioned, so no to the customizations. – Rebecca Chernoff Jan 19 '12 at 0:01
  • 1
    But it is possible to use a custom .js file, if we were to develop one, correct? Isn't that what was done with tex.se? – rm -rf Jan 19 '12 at 0:03

I believe StackExchange uses Google Prettify. This is an easily extensible framework. We should eventually try to extend it to support Mathematica properly. Unfortunately I don't know JavaScript, but I'd definitely play with it if I had more time (maybe later).

  • 1
    It would be great if we had correct syntax highlighting for mma... – acl Jan 18 '12 at 14:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .