What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 146 Stack Exchange communities.

I've just answered a question in SO where I had to post four snippets of XML (yes, it was a JavaEE question, how did you guess?)

I made an effort to keep the snippets short and meaningful, but all this code can clutter the visuals of the page, and moves attention away from the rest of the answer.

The site can already detect which parts of the question or answer are code, and paints them in a different font and background. What if it could also add a small toggle button that hides/display each snippet of code?

An example. Displayed: A crudely drawn image of a widget whose purpose is to collapse a block of code, complete with an arrow pointing to this widget and a description "button to hide snippet" of said widget.

Hidden: The same widget as before, only this time it is in a different state and the associated block of code has been truncated according to the requested feature's behaviour. An arrow continues to point at the widget but it is accompanied by another arrow pointing out that an ellipsis (...) symbol should be used to indicate the aforementioned truncation has taken place.

Please acknowledge my superior Photoshop skillzs.

share|improve this question
It's a bit of a clunkily edited question, but this proposal which asks for code collapse (and then some) has been denied. –  Grace Note Nov 24 '10 at 19:26
You people are too lazy to correctly add your alternate image text. I took the liberty of supplying it on your behalf. Think of Stack Overflow's visually impared users the next time you post images, Leonel. –  XMLbog Nov 24 '10 at 20:13
@26: you've inflicted superfluous "u"s on blind people yet again! Why do you hate the blind so? –  Shog9 Nov 24 '10 at 20:16
@shognine: I appeal to only the most Canadian of blind people. The blind people of lesser countries will have to make do. –  XMLbog Nov 24 '10 at 20:17
@26: Aye. A thousand apologies. I promise I'll be more careful next time. –  Leonel Nov 24 '10 at 20:36
Aside: the site does not "detect" code, it provides a formatting option for code (well, two one for inline and one for blocks). –  dmckee Nov 24 '10 at 21:12

You must log in to answer this question.

Browse other questions tagged .