Skip to content

Add spoiler class of fenced div#502

Merged
zkamvar merged 7 commits intocarpentries:mainfrom
tobyhodges:add-spoiler-class
Aug 30, 2023
Merged

Add spoiler class of fenced div#502
zkamvar merged 7 commits intocarpentries:mainfrom
tobyhodges:add-spoiler-class

Conversation

@tobyhodges
Copy link
Copy Markdown
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

Comment thread inst/rmarkdown/lua/lesson.lua Outdated
Copy link
Copy Markdown
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).

Comment thread inst/rmarkdown/lua/lesson.lua Outdated
Comment thread inst/rmarkdown/lua/lesson.lua Outdated
Comment thread tests/testthat/_snaps/render_html.md
@zkamvar
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Excellent, thanks @zkamvar 🙌

@zkamvar
Copy link
Copy Markdown
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