Replies: 2 comments
-
Hi @obrl-soil, is https://quarto.org/docs/output-formats/html-code.html#code-tools what you are looking? |
Beta Was this translation helpful? Give feedback.
0 replies
-
See below an example using JavaScript: ---
title: "Quarto Playground"
format: html
include-after-body:
- text: |
<script>
// select all elements with the data-bs-toggle attribute
const elements = document.querySelectorAll('[data-bs-toggle]');
// loop through the elements and toggle their collapsed state
elements.forEach(element => {
const isCollapsed = element.classList.contains('collapsed');
if (!isCollapsed) {
element.click();
}
});
</script>
---
This is a playground for Quarto.
::: {.callout-note collapse=false}
## Pay Attention
Using callouts is an effective way to highlight content that your reader give special consideration or attention.
::: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
HTML format only, obvs, and this is just a convenience suggestion.
I have some documents with multiple collapsible blocks on a single page. I think it would be handy to be able to offer a 'collapse all/un-collapse all' button on any or all of the navbars. This is mostly because the browser search functions (at least on Firefox) can't 'see inside' a collapsed block. Would anyone else find this useful? Is it even possible?
Beta Was this translation helpful? Give feedback.
All reactions