Skip to content

Commit

Permalink
more documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zkamvar committed Nov 21, 2023
1 parent d3dcb2f commit cec2e0a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
16 changes: 14 additions & 2 deletions R/Episode.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
#'
#' @description
#' Wrapper around an xml document to manipulate and inspect Carpentries episodes
#'
#' @details
#' This class is a fancy wrapper around the results of [tinkr::to_xml()] and
#' has method specific to the Carpentries episodes.
#' The Episode class is a superclass of [tinkr::yarn()], which transforms
#' (commonmark-formatted) Markdown to XML and back again. The extension that
#' the Episode class provides is support for both [Pandoc](https://pandoc.org)
#' and [kramdown](https://kramdown.gettalong.org/) flavours of Markdown.
#'
#' Read more about this class in `vignette("intro-episode", package =
#' "pegboard)`.
#'
#' @export
Episode <- R6::R6Class("Episode",
inherit = tinkr::yarn,
Expand Down Expand Up @@ -99,7 +106,12 @@ Episode <- R6::R6Class("Episode",
self$yaml <- ep$yaml
self$body <- ep$body
self$ns <- ep$ns
# if the parents are missing, this walk will do nothing
purrr::walk(parents, function(parent) add_parent(self, parent))
# the parent here is used to determine the build path for the
# child document, which is dependent on the build parent, aka the final
# ancestor. If there is no parent, then the children are relative to the
# parent.
self$children <- find_children(ep, ancestor = parents[[1]])
},

Expand Down
13 changes: 10 additions & 3 deletions R/Lesson.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
#'
#' @description
#' This is a wrapper for several [Episode] class objects.
#'
#' @details
#' Lessons are made of up several episodes within the `_episodes/` directory of
#' a lesson. This class keeps track of several episodes and allows us to switch
#' between RMarkdown and markdown episodes
#'
#' This class contains and keeps track of relationships between [Episode]
#' objects contained within [Carpentries
#' Workbench](https://carpentries.github.io/workbench) and [Carpentries
#' styles](https://carpentries.github.io/lesson-example) lessons.
#'
#' Read more about how to use this class in `vignette("intro-lesson", package =
#' "pegboard")`
#'
#' @export
Lesson <- R6::R6Class("Lesson",
public = list(
Expand Down
8 changes: 6 additions & 2 deletions man/Episode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/Lesson.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vignettes/intro-lesson.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ lapply(wb_lesson$built, class)
```

You can use these to inspect how the content is rendered and see that the
code blocks render what they should render:
code blocks render what they should render. In thise case, `episodes/intro.Rmd`
will render one output block and one image.

```{r summary-built}
to_check <- c("page", "code", "output", "images", "warning", "error")
Expand Down

0 comments on commit cec2e0a

Please sign in to comment.