Focussable & Collapsible code blocks. #3944
Replies: 2 comments 8 replies
-
Could you elaborate what you mean by focusable code blocks? It would be very helpful if you could provide some examples. Also, collapsible code blocks would probably need to be supported by the Highlight extension, which we use for highlighting. |
Beta Was this translation helpful? Give feedback.
-
I think that while Torchlight is great, from what I saw on the example link, I feel like it's a bit overkill for this purpose and more on the "fancy" trick side of things. What purpose would it serve other than just look "cool"? This is already an option for highlighting the lines you want to focus on using the hl_lines argument in your code block. For example, to highlight line 3 in your code block you would do this:
Which would work like so: As for collapsible code block, this is already available, see here: Collapsed
Not Collapsed
Example using both collapsible boxes and highlightingWrite your docs section like this:
CollapsedExpanded: |
Beta Was this translation helpful? Give feedback.
-
Was just going through the documentation for Torchlight (from #3943). Looks like they have focus sable & collapsible code blocks.
I believe this would be a great feature to have in mkdocs for material, since it makes following through code along examples, easier by just make the relevant code sections focused (while dimming the rest of the section). Even collapsible section (folded code blocks) makes it easier for the user to manually fold blocks in larger code examples and focus on one part.
Beta Was this translation helpful? Give feedback.
All reactions