Closed
Description
Context
No response
Description
Add option to make code blocks expandable so that only a few lines are shown at first place. A button below the code block will give the option to expand it entirely.
Related links
Use Cases
- Authors perspective: Long code blocks are sometimes required in references, how-to guides, examples, etc. However, they will break the reading flow of the page which can defeat the purpose of it. On the other hand, hiding code blocks with collapsible admonitions is the other extreme, which removes the visual stylistic device of having code bocks between paragraphs.
- User perspective: Large code blocks can lead to get lost/overwhelmed if new to a topic. Being able to read a page first, from top to bottom, helps to get a basic understanding before looking at details. Expandable code blocks encourage to do so and signalize that there is an important piece of code, but it can be skipped safely until it might be required later.
Visuals
Source: https://docs.aws.amazon.com/securityhub/latest/userguide/prepare-upcoming-features.html#appendix-sample-findings
Before submitting
- I have read and followed the change request guidelines.
- I have verified that my idea is a change request and not a bug report.
- I have ensured that, to the best knowledge, my idea will benefit the entire community.
- I have included relevant links to the documentation, related issues and discussions to underline the need for my idea.