You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Often times one only wants to display several lines of code. Displaying these lines without context could confuse the reader. Displaying them with surrounding lines could lead to reader cut and pasting duplicated code. Is there a way to "hide" contextual lines of code by default but reveal them, properly formatted and syntax highlighted, with the click of a button?
Describe alternatives you've considered
To show the contextual lines commented out, but then it wouldn't be properly formatted and syntax highlighted and could be confusing.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
(Sorry for my delayed reply while I've been traveling!)
That's a really interesting feature request. I really like the example you linked to! A couple of my initial thoughts:
The example you linked to seems to assume that code blocks with never have full-line text comments. Or maybe they're doing some fancy parsing to ensure that the full code-block is syntactically valid? I'm not sure, I'd have to give it a try.
We are kind-of limited by the default syntax-highlighter included with Jekyll. I think we'd need to switch to an in-browser syntax-highlighter to unlock features like this.
I'll give this further thought in the coming weeks.
Oh this could be as easy as adding a data-hidden-lines attribute 😅
My next question: How does this affect line numbers? Maybe this feature should only be allowed with the no-line-numbers variant? I'll need to give this further thought.
Is your feature request related to a problem? Please describe.
Often times one only wants to display several lines of code. Displaying these lines without context could confuse the reader. Displaying them with surrounding lines could lead to reader cut and pasting duplicated code. Is there a way to "hide" contextual lines of code by default but reveal them, properly formatted and syntax highlighted, with the click of a button?
Describe the solution you'd like
Like this: https://rust-lang.github.io/mdBook/format/theme/syntax-highlighting.html#hiding-code-lines
Describe alternatives you've considered
To show the contextual lines commented out, but then it wouldn't be properly formatted and syntax highlighted and could be confusing.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: