View source: R/get_challenges.R
get_challenges | R Documentation |
This will search an XML document for a challenge marker and extract all of the block quotes that are ancestral to that marker so that we can extract the challenge blockquotes from the carpentries lessons.
get_challenges(body, type = c("block", "div", "chunk"))
body |
the XML body of a carpentries lesson (an xml2 object) |
type |
the type of element containing the challenges "block" is the default and will search for all of the blockquotes with liquid/kramdown markup, "div" will search for all div tags with class of challenge, and "chunk" will search for all of code chunks with the engine of challenge. |
an xml object.
loop <- Episode$new(file.path(lesson_fragment(), "_episodes", "14-looping-data-sets.md"))
get_challenges(loop$body, "block")
get_challenges(loop$unblock()$body, "div")
loop$reset()
get_challenges(loop$use_dovetail()$unblock()$body, "chunk")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.