New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new tag to have a collapsed code-block with ability to expand #272
Comments
ah cool idea - is this something that should be done at the |
thanks @choldgraf that is a good point. I guess it will certainly need theme support of some kind? If we have the |
well I think that we could bundle the CSS for this with div.cell.collapse-20 {
max-height: 20em;
overflow-y: scroll;
} so that would propagate to other themes etc (though we'd need to make sure that we don't clobber other theme CSS I suppose) |
oh cool -- and using an internal |
Do you think this should be in |
maybe we can start out with MyST-NB and then fork it out if it seems useful enough. WDYT? |
@mmcky @choldgraf to me it feels like it should be somewhere else apart from |
We can probably specify the number of lines to show in a config variable and use css like this to configure |
It does seem like a "theme" thing rather than a myst-nb thing...I'd be +1 implementing it there, it is simple enough for other themes to implement themselves I suppose |
hmm. let me try out this one this week and see how it looks in the theme. |
@AakashGfude how did this trial go? Perhaps we can work on this next week. |
@AakashGfude I agree with you. I think this is more a
|
Is your feature request related to a problem? Please describe.
For long
code-block
andcode-cell
it would be nice to have a collapsed feature with a line specification. So for example it would load with only 20 lines showing and an ability to expand the block.https://myst-nb.readthedocs.io/en/latest/use/hiding.html#hiding-cell-contents
Describe the solution you'd like
Perhaps the tag could be
collapse-n
where n is the number of lines? (i.e.collapse-20
would have a cell with 20 lines (or less if content is less) showing.Describe alternatives you've considered
Not really any
Additional context
Would support displaying code cells like the one in this section:
https://python.quantecon.org/linear_algebra.html#Vector-Operations
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: