get_blocks | R Documentation |
This will search an XML document for block_quotes
with the specified type
and level and extract them into a nodeset.
get_blocks(body, type = NULL, level = 0)
body |
the XML body of a carpentries lesson (an xml2 object) |
type |
the type of block quote in the Jekyll syntax like ".challenge", ".discussion", or ".solution" |
level |
the level of the block within the document. Defaults to |
an xml nodeset object with each element representing a blockquote that matched the input criteria.
At the moment, blocks are returned at the specified level. If you
select type = ".solution", level = 1
, you will receive blocks that
contain solution blocks even though these blocks are almost always nested
within other blocks.
frg <- Lesson$new(lesson_fragment())
# Find all the blocks in the
get_blocks(frg$episodes[["17-scope.md"]]$body)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.