Zulip Chat Archive
Stream: new members
Topic: Collapsible sections for code blocks in Zulip?
aron (Mar 12 2025 at 20:55):
I know it's best to give full #mre's but sometimes the problem I'm working on has too much context for me to want to include all of it because the relevant part will be obscured by the heaps of irrelevant context.
In Zulip code blocks is there a way for me to specify that some section of code should be collapsed by default?
That way I could include all the context so that the code has no errors, while still letting me make it visually clear what part of my code snippet I'm trying to highlight for my question
Eric Wieser (Mar 12 2025 at 21:21):
I don't think it's possible
Eric Wieser (Mar 12 2025 at 21:22):
I guess that's all or nothing, but you could repeat the line you're asking about
aron (Mar 12 2025 at 21:38):
mm interesting, yeah...
although actually another option could be to show only the relevant parts in a snippet, but to include the full code in a lean playground link
Julian Berman (Mar 12 2025 at 21:42):
Pygments has this capability, it's called hl_lines
, but I can't see how/whether it's exposed in Zulip. Specifically I found https://github.com/zulip/zulip/blob/a264ab2355ff61c64c12496d28879b38229361be/zerver/lib/markdown/fenced_code.py#L87 mentioning it, but I can't get anything I've tried just now to actually respect that.
Last updated: May 02 2025 at 03:31 UTC