Skip to content

Commit 4235c9d

Browse files
authored
Merge pull request #215 from cmu-delphi/ndefries/support-public-and-dev-docs-site
Support public and dev docs site
2 parents a1ab6fb + 2faf053 commit 4235c9d

File tree

4 files changed

+44
-13
lines changed

4 files changed

+44
-13
lines changed

.github/workflows/pkgdown.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# update the documentation web site on pushes to `dev` branch.
66
on:
77
push:
8-
branches: [dev]
8+
branches: [main, dev]
99
pull_request:
10-
branches: [dev]
10+
branches: [main, dev]
1111
release:
1212
types: [published]
1313
workflow_dispatch:

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: epidatr
22
Type: Package
33
Title: Client for Delphi's 'Epidata' API
4-
Version: 1.1.0
4+
Version: 1.1.0.9000
55
Date: 2023-09-11
66
Authors@R:
77
c(

DEVELOPMENT.md

+38-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,52 @@
1-
## Development Environment
2-
3-
Relevant R commands
1+
## Setting up the development environment
42

53
```r
64
install.packages(c('devtools', 'pkgdown', 'styler', 'lintr')) # install dev dependencies
75
devtools::install_deps(dependencies = TRUE) # install package dependencies
86
devtools::document() # generate package meta data and man files
97
devtools::build() # build package
8+
9+
```
10+
11+
## Validating the package
12+
13+
```r
1014
styler::style_pkg() # format code
11-
lintr::lint_package() # lint package
15+
lintr::lint_package() # lint code
16+
1217
devtools::test() # test package
1318
devtools::check() # check package for errors
1419
```
1520

16-
## Release Process
21+
## Developing the documentation site
22+
23+
The [documentation site](https://cmu-delphi.github.io/epidatr/) is built off of the `main` branch. The `dev` version of the site is available at https://cmu-delphi.github.io/epidatr/dev.
24+
25+
The documentation site can be previewed locally by running in R
26+
27+
```r
28+
pkgdown::build_site(preview=TRUE)
29+
```
30+
31+
The `main` version is available at `file:///<local path>/epidatr/docs/index.html` and `dev` at `file:///<local path>/epidatr/docs/dev/index.html`.
32+
33+
You can also build the docs manually and launch the site with python. From the terminal, this looks like
34+
```bash
35+
R -e 'devtools::document()'
36+
python -m http.server -d docs
37+
```
38+
39+
For `pkgdown` to correctly generate both public (`main`) and `dev` documentation sites, the package version in `DESCRIPTION` on `dev` must have four components, and be of the format `x.x.x.9000`. The package version on `main` must be in the format `x.x.x`.
40+
41+
The documentation website is updated on push or pull request to the `main` and `dev` branches.
42+
43+
## Release process
44+
45+
### Manual
46+
47+
TBD
48+
49+
### Automated (currently unavailable)
1750

1851
The release consists of multiple steps which can be all done via the GitHub website:
1952

@@ -25,8 +58,3 @@ The release consists of multiple steps which can be all done via the GitHub webs
2558
2. create another [Pull Request](https://github.com/cmu-delphi/epidatr/pulls) to merge the changes back to the `dev` branch
2659
3. create a [GitHub release](https://github.com/cmu-delphi/epidatr/releases) with automatically derived release notes
2760
5. Release to CRAN
28-
29-
[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
30-
[mit-url]: https://opensource.org/license/MIT
31-
[github-actions-image]: https://github.com/cmu-delphi/epidatr/workflows/ci/badge.svg
32-
[github-actions-url]: https://github.com/cmu-delphi/epidatr/actions

_pkgdown.yml

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ template:
88
navbar-bg: '#C41230'
99
navbar-fg: '#f8f8f8'
1010

11+
development:
12+
mode: auto
13+
1114
navbar:
1215
bg: '#C41230'
1316
fg: '#f8f8f8'

0 commit comments

Comments
 (0)