From 6cff8cfc313233b6b80a83247e86e2f6a1543e79 Mon Sep 17 00:00:00 2001 From: Amanda Minter Date: Mon, 23 Oct 2023 13:44:44 +0100 Subject: [PATCH 1/2] Remove default episode `introduction.Rmd` --- config.yaml | 1 - episodes/introduction.Rmd | 125 -------------------------------------- 2 files changed, 126 deletions(-) delete mode 100644 episodes/introduction.Rmd diff --git a/config.yaml b/config.yaml index c559a8d9..091790fa 100644 --- a/config.yaml +++ b/config.yaml @@ -59,7 +59,6 @@ contact: 'andree.valle-campos@lshtm.ac.uk' #FIXME # Order of episodes in your lesson episodes: -- introduction.Rmd # Information for Learners learners: diff --git a/episodes/introduction.Rmd b/episodes/introduction.Rmd deleted file mode 100644 index d14b25e8..00000000 --- a/episodes/introduction.Rmd +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: "Using RMarkdown" -teaching: 10 -exercises: 2 ---- - -:::::::::::::::::::::::::::::::::::::: questions - -- How do you write a lesson using R Markdown and `{sandpaper}`? - -:::::::::::::::::::::::::::::::::::::::::::::::: - -::::::::::::::::::::::::::::::::::::: objectives - -- Explain how to use markdown with the new lesson template -- Demonstrate how to include pieces of code, figures, and nested challenge blocks - -:::::::::::::::::::::::::::::::::::::::::::::::: - -## Introduction - -This is a lesson created via The Carpentries Workbench. It is written in -[Pandoc-flavored Markdown](https://pandoc.org/MANUAL.txt) for static files and -[R Markdown][r-markdown] for dynamic files that can render code into output. -Please refer to the [Introduction to The Carpentries -Workbench](https://carpentries.github.io/sandpaper-docs/) for full documentation. - -What you need to know is that there are three sections required for a valid -Carpentries lesson template: - - 1. `questions` are displayed at the beginning of the episode to prime the - learner for the content. - 2. `objectives` are the learning objectives for an episode displayed with - the questions. - 3. `keypoints` are displayed at the end of the episode to reinforce the - objectives. - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: instructor - -Inline instructor notes can help inform instructors of timing challenges -associated with the lessons. They appear in the "Instructor View" - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -::::::::::::::::::::::::::::::::::::: challenge - -## Challenge 1: Can you do it? - -What is the output of this command? - -```r -paste("This", "new", "lesson", "looks", "good") -``` - -:::::::::::::::::::::::: solution - -## Output - -```output -[1] "This new lesson looks good" -``` - -::::::::::::::::::::::::::::::::: - - -## Challenge 2: how do you nest solutions within challenge blocks? - -:::::::::::::::::::::::: solution - -You can add a line with at least three colons and a `solution` tag. - -::::::::::::::::::::::::::::::::: -:::::::::::::::::::::::::::::::::::::::::::::::: - -## Figures - -You can also include figures generated from R Markdown: - -```{r pyramid, fig.alt = "pie chart illusion of a pyramid", fig.cap = "Sun arise each and every morning"} -pie( - c(Sky = 78, "Sunny side of pyramid" = 17, "Shady side of pyramid" = 5), - init.angle = 315, - col = c("deepskyblue", "yellow", "yellow3"), - border = FALSE -) -``` - -Or you can use standard markdown for static figures with the following syntax: - -`![optional caption that appears below the figure](figure url){alt='alt text for -accessibility purposes'}` - -![You belong in The Carpentries!](https://raw.githubusercontent.com/carpentries/logo/master/Badge_Carpentries.svg){alt='Blue Carpentries hex person logo with no text.'} - -::::::::::::::::::::::::::::::::::::: callout - -Callout sections can highlight information. - -They are sometimes used to emphasise particularly important points -but are also used in some lessons to present "asides": -content that is not central to the narrative of the lesson, -e.g. by providing the answer to a commonly-asked question. - -:::::::::::::::::::::::::::::::::::::::::::::::: - - -## Math - -One of our episodes contains $\LaTeX$ equations when describing how to create -dynamic reports with {knitr}, so we now use mathjax to describe this: - -`$\alpha = \dfrac{1}{(1 - \beta)^2}$` becomes: $\alpha = \dfrac{1}{(1 - \beta)^2}$ - -Cool, right? - -::::::::::::::::::::::::::::::::::::: keypoints - -- Use `.md` files for episodes when you want static content -- Use `.Rmd` files for episodes when you need to generate output -- Run `sandpaper::check_lesson()` to identify any issues with your lesson -- Run `sandpaper::build_lesson()` to preview your lesson locally - -:::::::::::::::::::::::::::::::::::::::::::::::: - -[r-markdown]: https://rmarkdown.rstudio.com/ From 9636747d2b58924d1bc732ad58507ca51182899a Mon Sep 17 00:00:00 2001 From: Amanda Minter Date: Mon, 23 Oct 2023 13:48:44 +0100 Subject: [PATCH 2/2] Revert "Remove default episode `introduction.Rmd`" This reverts commit 6cff8cfc313233b6b80a83247e86e2f6a1543e79. --- config.yaml | 1 + episodes/introduction.Rmd | 125 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 episodes/introduction.Rmd diff --git a/config.yaml b/config.yaml index 091790fa..c559a8d9 100644 --- a/config.yaml +++ b/config.yaml @@ -59,6 +59,7 @@ contact: 'andree.valle-campos@lshtm.ac.uk' #FIXME # Order of episodes in your lesson episodes: +- introduction.Rmd # Information for Learners learners: diff --git a/episodes/introduction.Rmd b/episodes/introduction.Rmd new file mode 100644 index 00000000..d14b25e8 --- /dev/null +++ b/episodes/introduction.Rmd @@ -0,0 +1,125 @@ +--- +title: "Using RMarkdown" +teaching: 10 +exercises: 2 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- How do you write a lesson using R Markdown and `{sandpaper}`? + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- Explain how to use markdown with the new lesson template +- Demonstrate how to include pieces of code, figures, and nested challenge blocks + +:::::::::::::::::::::::::::::::::::::::::::::::: + +## Introduction + +This is a lesson created via The Carpentries Workbench. It is written in +[Pandoc-flavored Markdown](https://pandoc.org/MANUAL.txt) for static files and +[R Markdown][r-markdown] for dynamic files that can render code into output. +Please refer to the [Introduction to The Carpentries +Workbench](https://carpentries.github.io/sandpaper-docs/) for full documentation. + +What you need to know is that there are three sections required for a valid +Carpentries lesson template: + + 1. `questions` are displayed at the beginning of the episode to prime the + learner for the content. + 2. `objectives` are the learning objectives for an episode displayed with + the questions. + 3. `keypoints` are displayed at the end of the episode to reinforce the + objectives. + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: instructor + +Inline instructor notes can help inform instructors of timing challenges +associated with the lessons. They appear in the "Instructor View" + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: challenge + +## Challenge 1: Can you do it? + +What is the output of this command? + +```r +paste("This", "new", "lesson", "looks", "good") +``` + +:::::::::::::::::::::::: solution + +## Output + +```output +[1] "This new lesson looks good" +``` + +::::::::::::::::::::::::::::::::: + + +## Challenge 2: how do you nest solutions within challenge blocks? + +:::::::::::::::::::::::: solution + +You can add a line with at least three colons and a `solution` tag. + +::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::: + +## Figures + +You can also include figures generated from R Markdown: + +```{r pyramid, fig.alt = "pie chart illusion of a pyramid", fig.cap = "Sun arise each and every morning"} +pie( + c(Sky = 78, "Sunny side of pyramid" = 17, "Shady side of pyramid" = 5), + init.angle = 315, + col = c("deepskyblue", "yellow", "yellow3"), + border = FALSE +) +``` + +Or you can use standard markdown for static figures with the following syntax: + +`![optional caption that appears below the figure](figure url){alt='alt text for +accessibility purposes'}` + +![You belong in The Carpentries!](https://raw.githubusercontent.com/carpentries/logo/master/Badge_Carpentries.svg){alt='Blue Carpentries hex person logo with no text.'} + +::::::::::::::::::::::::::::::::::::: callout + +Callout sections can highlight information. + +They are sometimes used to emphasise particularly important points +but are also used in some lessons to present "asides": +content that is not central to the narrative of the lesson, +e.g. by providing the answer to a commonly-asked question. + +:::::::::::::::::::::::::::::::::::::::::::::::: + + +## Math + +One of our episodes contains $\LaTeX$ equations when describing how to create +dynamic reports with {knitr}, so we now use mathjax to describe this: + +`$\alpha = \dfrac{1}{(1 - \beta)^2}$` becomes: $\alpha = \dfrac{1}{(1 - \beta)^2}$ + +Cool, right? + +::::::::::::::::::::::::::::::::::::: keypoints + +- Use `.md` files for episodes when you want static content +- Use `.Rmd` files for episodes when you need to generate output +- Run `sandpaper::check_lesson()` to identify any issues with your lesson +- Run `sandpaper::build_lesson()` to preview your lesson locally + +:::::::::::::::::::::::::::::::::::::::::::::::: + +[r-markdown]: https://rmarkdown.rstudio.com/