The new theme is showing only 14 lines per "code" block, that's making it almost impossible to read the code without using an external text editor. Some ideas to fix that problem...
- show all code lines (as far as I remember the old theme worked that way)
- show 50 lines instead of 14 lines
- match number of lines to window height divided by font height (if that's possible)
- add an "expand" button to show all lines (might require java script though)
Lines per "code" block
Moderator: Moderators
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Lines per "code" block
Yes, I agree that going back to showing all lines would be much more useful for this forum.
Re: Lines per "code" block
Here's a bookmarklet that will fix things on a page-by-page basis:
To instead fix the style, "content.css" has the following rule:
and the "max-height" rule could just be removed.
Code: Select all
javascript:(function(){for(var node of document.querySelectorAll(".codebox code")){node.style.maxHeight="100%";}})()
Code: Select all
.codebox code {
overflow: auto;
display: block;
height: auto;
max-height: 200px;
padding: 10px 8px;
font: 0.9em Monaco, "Andale Mono","Courier New", Courier, monospace;
line-height: 1.3em;
}
Re: Lines per "code" block
I'm not sure I see the problem - yes, it only displays 14 lines at once, but there's still a scrollbar at the right so you can see the rest of it (and there's a "SELECT ALL" so you can easily copy/paste it into your favourite editor). Honestly, I prefer it this way, because it means that when people post large chunks of 6502 sample code (i.e. hundreds of lines long), I don't have to scroll down for 10 seconds to get to the next post.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
P.S. If you don't get this note, let me know and I'll write you another.
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Lines per "code" block
Thanks lidnariq for the tip that this is a CSS property. I put this in CSS override plugin called Stylus to get unlimited code blocks:
I wouldn't mind a more complicated solution like collapse/expand buttons or some user option, or whatever, but this is a forum where a lot of code is shared, and much of the time being able to read it is essential to the content of the post.
Yes, sometimes people dump a big pile of useless code that should really be an attachment or a pastebin or something else, but personally I'd much rather have the occasional problem of scrolling past a long post than having a hard time reading all other code posts.
Code: Select all
.codebox code {
max-height: none;
}
I find this a pretty bad way to look at code. 14 lines is an extremely narrow view to try and understand what a piece of code is doing, especially when it's assembly. It hurts comprehension a lot.
I wouldn't mind a more complicated solution like collapse/expand buttons or some user option, or whatever, but this is a forum where a lot of code is shared, and much of the time being able to read it is essential to the content of the post.
Yes, sometimes people dump a big pile of useless code that should really be an attachment or a pastebin or something else, but personally I'd much rather have the occasional problem of scrolling past a long post than having a hard time reading all other code posts.