1
1
## Setting up the development environment
2
2
3
3
``` r
4
- install.packages(c(' devtools' , ' pkgdown' , ' styler' , ' lintr' )) # install dev dependencies
5
- devtools :: install_deps(dependencies = TRUE ) # install package dependencies
6
- devtools :: document() # generate package meta data and man files
7
- devtools :: build() # build package
4
+ install.packages(c(' devtools' , ' pkgdown' , ' styler' , ' lintr' , ' pak' )) # install dev dependencies
5
+ pak :: pkg_install(" ." ) # install package and dependencies
8
6
```
9
7
10
8
## Validating the package
@@ -13,8 +11,12 @@ devtools::build() # build package
13
11
styler :: style_pkg() # format code
14
12
lintr :: lint_package() # lint code
15
13
14
+ devtools :: check() # run R CMD check, which runs everything below
15
+ devtools :: document() # generate package meta data and man files
16
16
devtools :: test() # test package
17
- devtools :: check() # check package for errors
17
+ devtools :: build_vignettes() # build vignettes only
18
+ devtools :: run_examples() # run doc examples
19
+ devtools :: check(vignettes = FALSE ) # check package without vignettes
18
20
```
19
21
20
22
## Developing the documentation site
@@ -24,20 +26,16 @@ Our CI builds two version of the documentation:
24
26
- https://cmu-delphi.github.io/epiprocess/ from the ` main ` branch and
25
27
- https://cmu-delphi.github.io/epiprocess/dev from the ` dev ` branch.
26
28
27
- The documentation site can be previewed locally by running in R:
28
-
29
- ``` r
30
- # Should automatically open a browser
31
- pkgdown :: build_site(preview = TRUE )
32
- ```
33
-
34
- If the above does not open a browser, you can try using a Python server from the
35
- command line:
29
+ We include the script ` pkgdown-watch.R ` that will automatically rebuild the
30
+ documentation locally and preview it. It can be used with:
36
31
37
- ``` bash
38
- R -e ' devtools::document()'
39
- R -e ' pkgdown::build_site()'
40
- python -m http.server -d docs
32
+ ``` sh
33
+ # Make sure you have servr installed
34
+ R -e ' renv::install("servr")'
35
+ # Will start a local server
36
+ Rscript pkgdown-watch.R
37
+ # You may need to first build the site with
38
+ R -e ' pkgdown::build_site(".", examples = FALSE, devel = TRUE, preview = FALSE)'
41
39
```
42
40
43
41
## Versioning
0 commit comments