-
Notifications
You must be signed in to change notification settings - Fork 154
collapsible echos #833
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
Comments
interesting idea; can you share the project publicly? |
It's not a new idea. Quarto does this, example on my blog: https://calcwithdec.dev/posts/hearty-maths/ Observable notebooks also collapse code, but is a bit more elaborate obviously :) |
@declann if you want you can also make the project link from your original post public, so the link https://declann.observablehq.cloud/calculang-dx-pattern-exampling/graphing-calcs/graphing-calcs works for us. To do that, you can go to https://observablehq.com/projects/@declann, and using the three-dots-menu on the right, open the "Share" modal. (way on the edge. In retrospect that's probably too hidden) From there you can set it to be viewable by the public: |
Oh, I had no idea my project was private! It's public now! Thanks @mythmon |
Hi, A simple workaround to add collabsible echos is the following JS code block in a page:
used here. My rushed styling is trying to make the feature discreet: the important thing is that the code is present and accessible (in the right place) and I don't need to maintain a copy of it for presentation: code where I include the block above: Styling I currently use (no styling is better if you don't want to be as discreet as me): .code > summary {
opacity: 0.6;
font-size: 0.8em;
font-family: monospace;
}
.code > summary:hover {
opacity: 1;
font-size: 0.8em;
font-family: monospace;
}
.code > summary::marker {
content: ''
} In this exact case I show 3x JS blocks that are needed for reactivity purposes. An alternative workaround that lets me control the grouping is to simply put the blocks inside a html details tag - this works - so manual collapsing is easy. This issue is really a cosmetic one. I do think collasible is a good option and perhaps a good default, but opinions will differ! |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
is neat for documentation. I'm also using it to expose code for some visualizations, example:
https://declann.observablehq.cloud/calculang-dx-pattern-exampling/graphing-calcs/graphing-calcs
Here I added a manual collapsible code block also, using details tag (what Quarto does).
For me collapsible is more ergonomic and even moreso for inclusion in dashboards.
With CSS it might be possible to achieve some similar effect.
But are there plans to add a echo collapsible option?
Thanks
Declan
The text was updated successfully, but these errors were encountered: