-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from greta-dev/rc_0_3_0
v0.3.0 release candidate
- Loading branch information
Showing
306 changed files
with
26,508 additions
and
48,164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# building and contributing to the greta website | ||
|
||
This document explains how [the greta website](https://greta-stats.org) is built, and how to edit website content or add an analysis case study or an example model. Before you submit a pull request, please [open a GitHub issue](https://github.com/greta-dev/greta/issues/new) describing the content you'd like to change or add, and discuss it with the package maintainers. | ||
|
||
## building the website | ||
|
||
*greta* uses a customised [pkgdown](http://pkgdown.r-lib.org/) setup to build the greta website at [https://greta-stats.org](). This setup does not create the [greta forum](https://forum.greta-stats.org), which uses [discourse](https://www.discourse.org/) running on [a cloud server](https://www.digitalocean.com/docs/one-clicks/discourse/). | ||
|
||
Due to [a small bug in pkgdown](https://github.com/r-lib/pkgdown/pull/834), the build currently only works with fork of the main pkgdown repo. You can install that version with: | ||
|
||
``` | ||
devtools::install_github("goldingn/pkgdown@rmd_home_template") | ||
``` | ||
|
||
To rebuild the website, change your working directory to the top of the | ||
*greta* repository, and use the pkgdown `build_site()` function from within R: | ||
|
||
``` | ||
pkgdown::build_site() | ||
``` | ||
|
||
This will update the `docs` directory. You then need to commit those changes to the `git` repository, and push to github. | ||
|
||
The greta website is hosted by [netlify](https://www.netlify.com/), which will update the website after the files are pushed. | ||
|
||
## customising pkgdown | ||
|
||
The greta website build makes use of pkgdown's ability to customise templates, css, and the `_pkgdown.yml` configuration file, see the [`build_site()` documentation](http://pkgdown.r-lib.org/reference/build_site.html) for details. | ||
|
||
The page templates are stored in `inst/pkgdown/templates`, and the custom css is at `inst/pkgdown/assets/pkgdown.css`. The `index.Rmd` file also contains a small amount of html code to align the example on the home page. | ||
|
||
## updating existing pages | ||
|
||
The main website pages can be edited by making changes to Rmarkdown documents and re-building the website: | ||
|
||
To change ... | Edit ... | ||
--------------------|------------------------ | ||
Home page example | `index.Rmd` | ||
get started | `vignettes/get_started.Rmd` | ||
contribute | `vignettes/webpages/contribute.Rmd` | ||
software | `vignettes/webpages/software.Rmd` | ||
technical details | `vignettes/webpages/technical_details.Rmd` | ||
why greta | `vignettes/webpages/why_greta.Rmd` | ||
|
||
|
||
## adding analysis case studies | ||
|
||
To add an analysis case study, upload an Rmarkdown document to the `vignettes/analyses` folder, and edit 'menu' in the 'analyses' entry in the 'navbar' section of `_pkgdown.yml`, providing a short title and a relative path to the rendered output. E.g.: | ||
``` | ||
- text: my analysis | ||
href: articles/analyses/my_analysis.html | ||
``` | ||
|
||
## adding example models | ||
|
||
Example models should show how to define greta arrays representing a general type of statistical model, using an example dataset. They should not contain calls to `model()`, or any plotting or inference on models. Each example model is in a self-contained Rmarkdown file. | ||
|
||
To add an example model, create an R markdown file with the following components: | ||
|
||
### title | ||
|
||
Short, and s a level-3 header. | ||
|
||
### brief introductory text | ||
|
||
No more than a paragraph, please! | ||
|
||
### data section | ||
|
||
If needed, a level-4 header 'data' and a code chunk defining the data. The code chunk must have the chunk argument `highlight=FALSE`, and a chunk name that differs from the other example models and ends in `_data`. If the dataset is included with base R, this section can be omitted. | ||
|
||
### greta code section | ||
|
||
A level-4 header 'greta code' and an R code chunk defining the model in greta. The chunk name must that differ from the other example models and end in `_greta`. | ||
|
||
### BUGS/JAGS code | ||
|
||
If relevant, a level-4 header 'BUGS/JAGS code' and a (non-R) markdown code chunk giving the equivalent model in BUGS/JAGS code. The code block should be surrounded by an html `div` command defining a 'bugs' environment, which is used for code formatting. | ||
|
||
### Stan code | ||
If relevant, a level-4 header 'Stan code' and an R code chunk (with chunk argument `echo=FALSE`) with an R command to read in the equivalent model from the [Stan example models repository](https://github.com/stan-dev/example-models). The chunk name must that differ from the other example models and end in `_stan`. The code block should be surrounded by an html `div` command defining the Stan code formatting. | ||
|
||
### | ||
|
||
Here's a template: | ||
```` | ||
### my example model | ||
introduce the model here | ||
#### data | ||
```{r my_example_data, highlight = FALSE} | ||
``` | ||
#### greta code | ||
```{r my_example_greta} | ||
``` | ||
### BUGS/JAGS code | ||
<div class="bugs"> | ||
``` | ||
``` | ||
</div> | ||
### Stan code | ||
<div class="stan"> | ||
```{r my_example_stan, echo = FALSE} | ||
cat(readLines('https://raw.githubusercontent.com/stan-dev/example-models/master/ < path / to / model / code >.stan'), sep = '\n') | ||
``` | ||
</div> | ||
```` | ||
|
||
This should be saved as an .Rmd file with a meaningful name in the directory `inst/examples`. To add the example to the website, edit `vignettes/example_models.Rmd`, to add a horizontal rule and a code chunk in the relevant section, loading your example file as a child document. E.g.: | ||
|
||
```` | ||
<hr> | ||
```{r child='../inst/examples/my_example.Rmd'} | ||
``` | ||
```` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
^_pkgdown\.yml$ | ||
^.github$ | ||
^.netlify$ | ||
^.lintr$ | ||
^.travis.yml$ | ||
^docs$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
LICENSE | ||
README.Rmd | ||
README.md | ||
README_files | ||
README_cache | ||
logos | ||
.travis.yml | ||
docs | ||
man/figures/plot_greta_legend.R | ||
cran-comments.md | ||
vignettes/build_vignettes.R | ||
vignettes/example_models_cache | ||
vignettes/get_started_cache | ||
vignettes/technical_details_cache | ||
vignettes/get_started_files | ||
|
||
^CODE_OF_CONDUCT\.md$ | ||
^\.EDIT_WEBSITE\.md$ | ||
^LICENSE$ | ||
^cran-comments\.md$ | ||
|
||
^logos$ | ||
^inst/pkgdown$ | ||
|
||
^index\.Rmd$ | ||
^index_files$ | ||
^index_cache$ | ||
^index\.md$ | ||
|
||
^README\.Rmd$ | ||
^\.README\.Rmd$ | ||
^README\.md$ | ||
^README_files$ | ||
^README_cache$ | ||
|
||
^vignettes/get_started_cache$ | ||
^vignettes/example_models_cache$ | ||
^vignettes/webpages$ | ||
^vignettes/analyses$ | ||
|
||
^man/figures/vis-1\.png$ | ||
^man/figures/plot_greta_legend\.R$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Contributing to greta | ||
|
||
We love receiving contributions to greta! To make the prcoess as smooth as | ||
possible, this outlines how to propose a change to greta. It's based on the | ||
contributing guidelines for the tidyverse project. | ||
|
||
### Fixing typos | ||
|
||
Small typos or grammatical errors in documentation may be edited directly using | ||
the GitHub web interface, so long as the changes are made in the _source_ file. | ||
|
||
* YES: you edit a roxygen comment in a `.R` file below `R/`. | ||
* NO: you edit an `.Rd` file below `man/`. | ||
|
||
### Prerequisites | ||
|
||
Before you make a substantial pull request, you should always file an issue and | ||
make sure someone from the team agrees that it’s a problem. If you’ve found a | ||
bug, create an associated issue and illustrate the bug with a minimal | ||
[reprex](https://www.tidyverse.org/help/#reprex). | ||
|
||
### Pull request process | ||
|
||
* We recommend that you create a Git branch for each pull request (PR). | ||
* Look at the Travis and AppVeyor build status before and after making changes. | ||
The `README` should contain badges for any continuous integration services used | ||
by the package. | ||
* New code should follow the tidyverse [style guide](http://style.tidyverse.org). | ||
You can use the [styler](https://CRAN.R-project.org/package=styler) package to | ||
apply these styles, but please don't restyle code that has nothing to do with | ||
your PR. | ||
* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with | ||
[Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/markdown.html), | ||
for documentation. | ||
* We use [testthat](https://cran.r-project.org/package=testthat). Contributions | ||
with test cases included are easier to accept. | ||
* For user-facing changes, add a bullet to the top of `NEWS.md` below the | ||
current development version header describing the changes made followed by your | ||
GitHub username, and links to relevant issue(s)/PR(s). | ||
|
||
### Code of Conduct | ||
|
||
Please note that the greta project is released with a | ||
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this | ||
project you agree to abide by its terms. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Please briefly describe your problem and what output you expect. | ||
|
||
If you have a question, please don't use this form. Instead, ask on <https://forum.greta-stats.org/>. | ||
|
||
Please include a minimal reproducible example (AKA a reprex). If you've never heard of a [reprex](http://reprex.tidyverse.org/) before, start by reading <https://www.tidyverse.org/help/#reprex>. | ||
|
||
--- | ||
|
||
Brief description of the problem | ||
|
||
```r | ||
# insert reprex here | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
linters: with_defaults(commas_linter = NULL, object_usage_linter = NULL) | ||
exclude: "# Exclude Linting" | ||
exclude_start: "# Begin Exclude Linting" | ||
exclude_end: "# End Exclude Linting" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"site_id":"03e9a74b-bfe7-4279-9666-10e43f5af467","path":"docs"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Contributor Code of Conduct | ||
|
||
As contributors and maintainers of this project, we pledge to respect all people who | ||
contribute through reporting issues, posting feature requests, updating documentation, | ||
submitting pull requests or patches, and other activities. | ||
|
||
We are committed to making participation in this project a harassment-free experience for | ||
everyone, regardless of level of experience, gender, gender identity and expression, | ||
sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. | ||
|
||
Examples of unacceptable behavior by participants include the use of sexual language or | ||
imagery, derogatory comments or personal attacks, trolling, public or private harassment, | ||
insults, or other unprofessional conduct. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, | ||
commits, code, wiki edits, issues, and other contributions that are not aligned to this | ||
Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed | ||
from the project team. | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by | ||
opening an issue or contacting one or more of the project maintainers. | ||
|
||
This Code of Conduct is adapted from the Contributor Covenant | ||
(http://contributor-covenant.org), version 1.0.0, available at | ||
http://contributor-covenant.org/version/1/0/0/ |
Oops, something went wrong.