http://qs321.pair.com?node_id=11117164


in reply to Re: Adding details with summary html tags
in thread Adding details with summary html tags

IMHO the best solution for overly long code sections would be an "automatic/DWIM" shrink to 10-15 lines on display of <code></code> using CSS and/or JS.

Any toggle would be simple to implement then.

This could even be configured by display settings and wouldn't require learning any new tags.

I think I've seen this before elsewhere.

This is just a suggestion, I can't volunteer implementing it right now.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^3: Adding details with summary html tags
by kcott (Archbishop) on May 23, 2020 at 18:59 UTC

    Firstly, I have no problems with what you've written.

    I did just want to clarify that I wasn't advocating the introduction of a Show/Hide mechanism; rather, that I would "support (at least in principle)" a proposal to do so. To be honest, I only very rarely want to hide <spoiler> content after I've revealed it — the last time was probably more than a year ago — so, for me personally, the absence of a Show/Hide mechanism is of little concern.

    — Ken

      > To be honest, I only very rarely want to hide content after I've revealed it

      I'm afraid I wasn't clear enough. My idea is to shrink every long code section and to provide a toggle.

      Values for max-length and min-shrink could be individually set by the reading user.

      Another approach would be a limited div with scrollbars, I think github is using this.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        Thanks for the clarification.

        As for the "shrink" idea, assuming those min/max values can be set by each user, I think that might be a good way to go.

        However, I'm not sold on the "scrollbars" idea. I have seen this on a number of sites (including GitHub) and I generally don't like it: the scrolling windows typically only allow a very limited number of lines and I feel like I've regressed to the 80x24 screens I had to use many decades ago (in many cases, there's far less than 24 lines in the scrolling window). If you're only talking about vertical scrolling, and the height of the scrolling window could be adjusted — in Settings, with CSS, or using some other mechanism — I might be more amenable to this suggestion. I strongly dislike having to scroll code (or data or whatever) in two directions: horizontal scrollbars would not get my support.

        I appreciate we're just kicking around ideas here. Any substantial discussion should be done in its own thread. I probably wrote too much about "scrollbars" for a "Re^5" post in a thread about introducing HTML5 elements.

        — Ken