Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support public and dev docs site #215

Merged
merged 6 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# update the documentation web site on pushes to `dev` branch.
on:
push:
branches: [dev]
branches: [main, dev]
pull_request:
branches: [dev]
branches: [main, dev]
release:
types: [published]
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: epidatr
Type: Package
Title: Client for Delphi's 'Epidata' API
Version: 1.1.0
Version: 1.1.0.9000
Date: 2023-09-11
Authors@R:
c(
Expand Down
48 changes: 38 additions & 10 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,52 @@
## Development Environment

Relevant R commands
## Setting up the development environment

```r
install.packages(c('devtools', 'pkgdown', 'styler', 'lintr')) # install dev dependencies
devtools::install_deps(dependencies = TRUE) # install package dependencies
devtools::document() # generate package meta data and man files
devtools::build() # build package

```

## Validating the package

```r
styler::style_pkg() # format code
lintr::lint_package() # lint package
lintr::lint_package() # lint code

devtools::test() # test package
devtools::check() # check package for errors
```

## Release Process
## Developing the documentation site

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.

The documentation site can be previewed locally by running in R

```r
pkgdown::build_site(preview=TRUE)
```

The `main` version is available at `file:///<local path>/epidatr/docs/index.html` and `dev` at `file:///<local path>/epidatr/docs/dev/index.html`.

You can also build the docs manually and launch the site with python. From the terminal, this looks like
```bash
R -e 'devtools::document()'
python -m http.server -d docs
```

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`.

The documentation website is updated on push or pull request to the `main` and `dev` branches.

## Release process

### Manual

TBD

### Automated (currently unavailable)

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

Expand All @@ -25,8 +58,3 @@ The release consists of multiple steps which can be all done via the GitHub webs
2. create another [Pull Request](https://github.com/cmu-delphi/epidatr/pulls) to merge the changes back to the `dev` branch
3. create a [GitHub release](https://github.com/cmu-delphi/epidatr/releases) with automatically derived release notes
5. Release to CRAN

[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
[mit-url]: https://opensource.org/license/MIT
[github-actions-image]: https://github.com/cmu-delphi/epidatr/workflows/ci/badge.svg
[github-actions-url]: https://github.com/cmu-delphi/epidatr/actions
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ template:
navbar-bg: '#C41230'
navbar-fg: '#f8f8f8'

development:
mode: auto

navbar:
bg: '#C41230'
fg: '#f8f8f8'
Expand Down