Skip to content
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 spoiler class of fenced div #502

Merged
merged 7 commits into from
Aug 30, 2023

Conversation

tobyhodges
Copy link
Member

@tobyhodges tobyhodges commented Aug 21, 2023

Adds a spoiler class of accordion fenced div, which could be used instead of "floating" solution blocks where the user wants to give the option to view/hide additional detail.

Styling for this class would be added by carpentries/varnish#92

Copy link
Contributor

@zkamvar zkamvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start and I really appreciate your digging into lua to get this working!

I've left a couple of comments that will clean up the code a bit.

It would be good to add an example in the tests/testthat/examples/ex.md, which is tested in tests/testthat/test-render_html.R using snapshot testing.

The tests will fail when you add it, but I will fenagle the tests to be better at filtering (there is a weird thing with pandoc where the attributes are added in a random order, which messes up the tests, so I have to manually clean them up in the test).

inst/rmarkdown/lua/lesson.lua Outdated Show resolved Hide resolved
inst/rmarkdown/lua/lesson.lua Outdated Show resolved Hide resolved
tests/testthat/_snaps/render_html.md Outdated Show resolved Hide resolved
@zkamvar
Copy link
Contributor

zkamvar commented Aug 29, 2023

After updating varnish, I see this, so I think we can declare that it works!

a page with a spoiler dropdown menu that is clicked open to reveal a cute kitten with the caption of "surprise"

@tobyhodges
Copy link
Member Author

Excellent, thanks @zkamvar 🙌

@zkamvar
Copy link
Contributor

zkamvar commented Aug 30, 2023

Thank you Toby!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants