The discussion revolves around the feature to resize code blocks in posts. ganncamp initiated the conversation, seeking a feature or theme to allow readers to resize code blocks, especially when dealing with logs.
A potential solution was proposed by Falco to reuse the “Expand Table” feature for code blocks. ganncamp experimented with CSS to add vertical resize, but encountered issues with code block height.
Canapin suggested using white-space: break-spaces; for word wrap, but ganncamp explained that code blocks should not wrap.
martin shared a feature to fullscreen code blocks, which can be enabled by setting show_copy_button_on_codeblocks. This feature adds a fullscreen button to code blocks with horizontal scroll, and ganncamp found it to be a nice interim step.
However, Jose_C_Gomez encountered issues with the copy button not showing, and martin clarified that the expand button only shows if the code block scrolls horizontally.
The discussion concludes with ganncamp reiterating the need for inline resizable code blocks, citing limitations with the current fullscreen feature.
I actually did some work earlier in the year to fullscreen code blocks. First, you have to have the show_copy_button_on_codeblocks setting enabled. Then, any code block that has a horizontal scroll will have 2 buttons – the copy button and the fullscreen button (the copy button will be there regardless):
@Canapin you really don’t want code blocks to wrap. That’s actually why I format 99% of the posts that I touch: to put the things that shouldn’t linewrap in code blocks.
And thanks for the tip @martin. I may try this in the meantime, but I’m still holding out hope for inline resize…
I’ve turned on show_copy_button_on_codeblocks and this is a nice interim step.
Worth noting that you have to actually mouseover the code block for the buttons to show up. I thought at first it wasn’t working.
And on the topic of inline resizable code blocks, it might be worth pointing out that the Data Explorer SQL editor is fully resizable. (I know the page is built differently, but…)
The expand button will only show if the code block scrolls horizontally. I am not sure why the copy button wouldn’t show. It is hidden until you hover the code block, maybe that’s it?