Is there a way for a reader (not the OP) to expand a scrollable window containing source code in a question? I sometimes have difficulty understanding a block of code because I can't see it all at once. I find myself having to continually scroll the code up and down within the window. It would be nice to be able to request that the code in all of its entirety be displayed in the question.
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
I wrote a greasemonkey/chrome user script about a year ago that does this. It's up on stackapps if you're interested.
From the link, its features are:
I really like this feature request. It focuses purely on making it easier for answerers to focus on looking at a problem and then creating great content. Here is a screenshot of one of the prettyprint windows expanded with some CSS manipulations:
Run this in the console to manipulate the window. This could either launch as a popup, which makes it easy to alt-tab back and forth, or just remain embedded in the page:
Of course, there is a downside to this: It may encourage more help vampires to post their entire project. We do know that Q&A tends to work best when it's represented in bite-sized, broken down components that focus on a single problem.
Ok, this question has been around a while! But it is exactly what I was going to ask about. And I have a possible solution. When you are on a web site which includes photos, you can often click the photo and it opens up in a "modal" fashion to take up the entire window, and you see the photo in as large an area as the window allows. Often there will be an X in the upper right corner, and perhaps some zoom features. Pressing the Esc key often can close it. Left and Right arrows can go to the next or previous photo.
Why not do this with code blocks? Add an "expand" button next to (or above/below) the code sample. When clicked, it expands to take the entire window (full width, full height please!). Perhaps with "zoom" buttons so those younger folks can click the "zoom out" to see more at once, and the older folks can click "zoom in" if necessary when they eyes stop working like they used to. And of course you could easily scroll both directions, perhaps there would even be a "copy to clipboard" button to copy the entire sample. And for answers with multiple code blocks, the left and right arrows could bring up the previous or next code block from the question or answer.