Skip to content

Is there a way to add a button or something that could collapse/uncollapse all the admonitions in a page? #7685

Answered by kamilkrzyskow
jonaprieto asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @jonaprieto,
yes, it's possible to do so using extra JavaScript:

You can reference the other discussions, which also were related to JS:

The logic should be simple, keep track of the state of the button to decide whether to collapse or uncollapse, after press go over all details tags on the page and change the state from the button, since you're enforcing the state from the button you don't need to check the state of the separate details.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonaprieto
Comment options

Answer selected by jonaprieto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants