-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathintroduction.Rmd
More file actions
125 lines (80 loc) · 3.83 KB
/
Copy pathintroduction.Rmd
File metadata and controls
125 lines (80 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
title: "Using RMarkdown"
teaching: 10 # teaching time in minutes
exercises: 2 # exercise time in minutes
---
:::::::::::::::::::::::::::::::::::::: 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:
`{alt='alt text for
accessibility purposes'}`
{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/