forked from datacarpentry/R-ecology-lesson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CONTRIBUTING.Rmd
156 lines (118 loc) · 6.23 KB
/
CONTRIBUTING.Rmd
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Contributing
[Data Carpentry](https://datacarpentry.org) in an open source project, and we
welcome contributions of all kinds: new lessons, fixes to existing material, bug
reports, and reviews of proposed changes are all welcome.
## Contributor Agreement
By contributing, you agree that we may redistribute your work
under [our license](https://datacarpentry.org/R-ecology-lesson/LICENSE.html).
In exchange, we will address your issues and/or assess your change proposal as
promptly as we can, and help you become a member of our community. Everyone
involved in [Software Carpentry](https://software-carpentry.org)
and [Data Carpentry](https://datacarpentry.org) agrees to abide by
our
[code of conduct](https://datacarpentry.org/R-ecology-lesson/CONDUCT.html).
## Working With GitHub
1. Fork the `datacarpentry/R-ecology-lesson` repository on GitHub. *See the
"Fork" button in the top-right corner of the screen on the GitHub website.*
2. Clone that repository to your own machine. (It is also possible
to make minor edits right on GitHub.) *At your terminal:*
```bash
git clone https://github.com/your_username/R-ecology-lesson.git R-ecology-lesson
cd R-ecology-lesson
git remote add upstream https://github.com/datacarpentry/R-ecology-lesson.git
```
3. Create a branch from `master` for your changes.
Give your branch a meaningful name,
such as `fix-typos-dplyr-lesson`
or `add-tutorial-on-visualization`. *At your terminal:*
```bash
git checkout -b fix-typos-dplyr-lesson
```
4. Make your changes to the Rmd file. If you'd like to check the rendered
version of your changes, you can do one of three things:
* if you have `GNU Make` installed on your system, type `make` at your shell
terminal.
* if you use RStudio, click on the "Knit" button in the top-right corner of
your editor pane.
* in other cases, you can type:
`rmarkdown::render_site("01-intro-to-r.Rmd")` in your R terminal (make
sure your working directory is at the root of the lesson) to generate the
corresponding html file.
5. Commit the Rmd file you edited (`git add file-you-changed.Rmd`, followed by
`git commit -m "fix typos in dplyr lesson"`), and push your changes to your
repository on GitHub (`git push origin fix-typos-dplyr-lesson`). If your
change affects a lesson, **please only commit and push the `Rmd`
files**. The rendered versions will be generated by the lesson maintainers
to avoid merge conflicts.
5. Send a pull request (PR) to the `master` branch of the
`datacarpentry/R-ecology-lesson` repository for this lesson at
https://github.com/datacarpentry/R-ecology-lesson
If it is easier for you to send edits to us some other way, please
mail us at [[email protected]](mailto:[email protected]).
Given a choice between you creating content or wrestling with Git,
we'd rather have you doing the former.
## File Locations and Formats
Each lesson is composed of files such as `00-before-we-start.Rmd`,
`01-intro-to-r.Rmd` and so on. (We use two digits followed by a
topic key to ensure files appear in the right order when listed.)
For the R material, lessons must be written in RMarkdown (ending in
`Rmd`). A Makefile converts the Rmd files into HTML that are
processed by Jekyll (the tool GitHub uses to create websites) as
explained in [the README file](https://github.com/datacarpentry/R-ecology-lesson#readme).
_Important Note:_ We use the `purl()` function from `knitr` to
generate a skeleton file that contains code to be distributed to
the workshop participants. This strategy is useful in particular
for error-prone pieces of code (e.g., if it contains long URLs). To
take full advantage, every line of code that should be included in
the handout **must** be enclosed in an `R` code chunk with
`purl=TRUE` in the chunk options. Further, to aid students' use of
the handout code, consider including explanatory comments. When
writing Challenges in particular, you may need to include redundant
comments and used the chunk option `echo=FALSE`. When in doubt,
consult the `Rmd` files for examples.
Images (e.g., screenshots) go into the `img/` folder. Graphics
generated by some R code also go into this folder and get the prefix
`R-ecology-`. This latter case is handled automatically with some
knitr options in the `setup.R` file.
Raw data go into `data_raw/`. However, at this stage, this folder is
created programmatically and only contain dataset downloaded directly
from the Figshare repository. In other words, it can be safely be
deleted (e.g. using `make clean-data` or `make clean`.)
The `data/` folder only contains data generated/exported by R
code.
The `site_libs` folder is generated by the **rmarkdown** package and
holds the javascript, css, and fonts used by the website.
We aim to have our lessons be as self-contained as possible. Images and
other external resources should be included in the repository whenever possible.
## Datasets
We don't store data for lessons inside the lesson repositories. For
completed lessons the data should be publicly available in a data
repository appropriate to the data type. For lesson development the
data may be provided in any way that is convenient including
posting to a website, on [figshare](https://figshare.com/), a public
Dropbox link, a [GitHub gist](https://gist.github.com), or even
included in the pull request (PR). Once the PR is ready to merge the data should
be placed in the [official data repository](https://doi.org/10.6084/m9.figshare.1314459.v5)
and all links to the data updated.
## Formatting of the material
To ensure a consistent formatting of the lessons, we recommend the
following guidelines:
* No trailing white space
* Wrap lines at 80 characters (unless it breaks URLs)
* Use consistent capitalization (e.g., R not r, RStudio not rstudio
or Rstudio)
* Function names are written as `function()` while variables are
written as `variable`, and package names as **`package`**.
* Use unclosed atx style headers (see below):
```
## Use this format for headers
And not this format
-------------------
```
## FAQ
* *Where can I get help?*
<br/>
Mail us at [[email protected]](mailto:[email protected])
or come chat with us on [our Gitter chat](https://gitter.im/data-carpentry/Lobby).
```{r, child="_page_built_on.Rmd"}
```