Skip to content

Commit 3b83aa9

Browse files
authored
Merge branch 'main' into newstemplate.Rmd-pt-auto
2 parents fbbea3d + af1ed5c commit 3b83aa9

32 files changed

+234
-328
lines changed

.github/CONTRIBUTING.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
### Suggestions and updates
2+
3+
This book contains our guidelines for packages contributed to [the rOpenSci suite of packages](https://ropensci.org/packages/).
4+
They are always a work in progress - corrections, suggestions and general improvements are welcome as [issue submissions in this repository](https://github.com/ropensci/dev_guide/issues/new).
5+
Open discussions are welcome in our [forum](https://discuss.ropensci.org/).
6+
You can also suggest changes by editing the `.Rmd` files that are at the root of this repository and submitting a pull request.
7+
An "edit" button in all book chapters will take you directly to the relevant page on GitHub to make such changes.
8+
Please target your pull requests to the `main` branch.
9+
10+
### Technical details
11+
12+
Deployment is done via [GitHub Actions](.github/workflows).
13+
The book has a [production version](https://devguide.ropensci.org/) and a [development version](https://devdevguide.netlify.com/).
14+
Both are updated when there are changes in their sources but also once a day to ensure the reviewers list is up to date (data pulled from Airtable).
15+
16+
* [prod.yml](.github/workflows/prod.yml): whenever there's a GitHub release, the book is built and its content is then pushed to the `gh-pages` branch. That branch serves ropensci.github.io/dev_guide which is redirected to https://devguide.ropensci.org/
17+
18+
* [scheduled-manual-main.yml](scheduled-manual-main.yml): once a day the book is built with the source from the latest release (see "Checkout latest release tag" step) and pushed to the `gh-pages` branch.
19+
20+
* [dev.yml](.github/workflows/dev.yml): whenever there's a push to the default branch `main`, and once a day, the book is built and its content is then pushed to the `dev-site` branch that gets [deployed to Netlify](https://devdevguide.netlify.com/).
21+
22+
* [pr.yml](.github/workflows/dev.yml): whenever there's a pull request to the default branch `main`, the book is built and its content is deployed via Netlify.
23+
24+
Refer to [this blog post for more details and resources about bookdown deployment on GitHub Actions](https://ropensci.org/blog/2020/04/07/bookdown-learnings/#5-how-to-deploy-a-preview-of-the-book-for-pull-requests).
25+
26+
### Notes for associate editors
27+
28+
If you're an associate editor, you can also push directly to `main` for small fixes.
29+
We shall use PRs to `main` for discussing larger updates.
30+
31+
If you're an associate editor and you want to render the book locally you need to install Quarto and the other dependencies stated in [DESCRIPTION](DESCRIPTION) in particular use `pak::pak("bergant/airtabler")`, and [get and store an Airtable API key following their instructions](https://github.com/bergant/airtabler#get-and-store-the-api-key) (if you're not an editor, you don't have access to our Airtable base but you can still build the book, although the Airtable info will be missing).
32+
Then use `babelquarto::render_book()` and the book will be generated in the `_book` folder; you can open the book by for instance running `servr::httw("_book")`.
33+
34+
### How to maintain translations
35+
36+
Any commit to main that edits a page with translations (say, `index.Rmd`) needs to also update the translations.
37+
If you have a PR open, with commits to a chapter in one language you can either provide your own translations,
38+
generate automated translations, or request translations from the maintenance team.
39+
40+
- For your own translations, follow the guidance in the [rOpenSci Localization and Translation Guidelines](https://translationguide.ropensci.org)
41+
42+
- To generate automated translations, you can use the {babeldown} package, wheich requires an API key from [DeepL](https://www.deepl.com). [`babeldown::deepl_update()`](https://docs.ropensci.org/babeldown/reference/deepl_update.html) generates translations to edited sections of the `.Rmd` (see this [blog post](https://ropensci.org/blog/2024/01/16/deepl-update-babeldown/)), and should be used once per translated langauge.
43+
44+
- If you are unable to provide your own or automated translations, for support for complex translations, or just tiny changes, (one sentence or so), tag the `@ropensci/dev-guide` team in your PR to request support from the maintainer team.
45+
46+
The PR will require a reviewer for each language.
47+
48+
# Meta
49+
50+
All of the content of this repository is licensed
51+
[CC-BY-SA](https://creativecommons.org/publicdomain/zero/1.0/).
52+
53+
You can cite this book using [its Zenodo metadata and DOI](https://doi.org/10.5281/zenodo.2553043).

.github/workflows/prod.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/scheduled-manual-main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,48 @@ on:
55

66
name: Rerender-released-Book
77

8+
89
jobs:
910
bookdown:
1011
env:
1112
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1213
name: Render-Book
1314
runs-on: ubuntu-latest
1415
steps:
15-
- name: Checkout
16-
uses: actions/checkout@main
16+
- uses: actions/checkout@v2
1717
with:
1818
fetch-depth: 0
19-
19+
2020
- name: Checkout latest release tag
2121
run: |
2222
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
2323
git checkout $LATEST_TAG
2424
2525
- uses: r-lib/actions/setup-r@v2
2626

27+
- uses: quarto-dev/quarto-actions/setup@v2
28+
with:
29+
version: pre-release
30+
2731
- uses: r-lib/actions/setup-pandoc@v2
2832

2933
- uses: r-lib/actions/setup-tinytex@v2
3034

3135
- uses: r-lib/actions/setup-r-dependencies@v2
3236
with:
33-
extra-packages: |
34-
any::bookdown
37+
extra-packages: local::.
3538

36-
- name: Render book html
37-
run: Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::bs4_book", params = list(AIRTABLE_API_KEY = ${{ secrets.AIRTABLE_API_KEY }}))'
39+
- name: Render book
40+
run: Rscript -e 'babelquarto::render_book()'
3841
env: # Set the secret as an input
3942
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
4043
ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }}
4144

42-
- name: Render book PDF
43-
run: Rscript -e 'bookdown::render_book("index.Rmd", new_session = FALSE, "bookdown::pdf_book", output_dir = "pdfbook", params = list(AIRTABLE_API_KEY = ${{ secrets.AIRTABLE_API_KEY }}))'
44-
env: # Set the secret as an input
45-
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }}
46-
ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }}
45+
- name: Move English files
46+
run: Rscript -e 'file.copy(from = "_book/rOpenSci-Packages--Development,-Maintenance,-and-Peer-Review.pdf", to = "_book/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/images")'
4747

48-
- name: Move files around
49-
run: Rscript -e 'file.copy(from = "pdfbook/ropensci-dev-guide.pdf", to = "_book/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/images")'
48+
- name: Move Spanish files
49+
run: Rscript -e 'file.copy(from = "_book/es/rOpenSci-Packages--Development,-Maintenance,-and-Peer-Review.pdf", to = "_book/es/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/es/images")'
5050

5151
- name: git config
5252
run: |

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Imports:
99
babelquarto,
1010
gert,
1111
humaniformat,
12-
rvest,
12+
purrr,
1313
usethis,
1414
withr
1515
Remotes:

README.md

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,9 @@ rOpenSci Packages: Development, Maintenance, and Peer Review
44
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
55
[![DOI](https://zenodo.org/badge/126815002.svg)](https://zenodo.org/badge/latestdoi/126815002)
66

7-
rOpenSci's guide for packages in our suite. [Read it here](https://devguide.ropensci.org/).
7+
rOpenSci's [guide for packages in our suite](https://devguide.ropensci.org/).
8+
[Development version](https://devdevguide.netl).
89

910
## Contributing
1011

11-
### Suggestions and updates
12-
13-
This book contains our guidelines for packages contributed to [the rOpenSci suite of packages](https://ropensci.org/packages/). They are always a work in progress - corrections, suggestions and general improvements are welcome as [issue submissions in this repository](https://github.com/ropensci/dev_guide/issues/new). Open discussions are welcome in our [forum](https://discuss.ropensci.org/). You can also suggest changes by editing the `.Rmd` files that are at the root of this repository and submitting a pull request. An "edit" button at the top of all book chapters will take you directly to the relevant page on GitHub to make such changes. Please target your pull requests to the `main` branch.
14-
15-
### Technical details
16-
17-
Deployment is done via [GitHub Actions](.github/workflows).
18-
The book has a production version https://devguide.ropensci.org/ and a development version https://devdevguide.netlify.com/
19-
Both are updated when there are changes in their sources but also once a day to ensure the reviewers list is up to date (data pulled from Airtable).
20-
21-
* [prod.yml](.github/workflows/prod.yml): whenever there's a GitHub release, the book is built and its content is then pushed to the `gh-pages` branch. That branch serves ropensci.github.io/dev_guide which is redirected to https://devguide.ropensci.org/
22-
23-
* [scheduled-manual-main.yml](scheduled-manual-main.yml): once a day the book is built with the source from the latest release (see "Checkout latest release tag" step) and pushed to the `gh-pages` branch.
24-
25-
* [dev.yml](.github/workflows/dev.yml): whenever there's a push to the default branch `main`, and once a day, the book is built and its content is then pushed to the `dev-site` branch that gets [deployed to Netlify](https://devdevguide.netlify.com/).
26-
27-
* [pr.yml](.github/workflows/dev.yml): whenever there's a pull request to the default branch `main`, the book is built and its content is deployed via Netlify.
28-
29-
Refer to [this blog post for more details and resources about bookdown deployment on GitHub Actions](https://ropensci.org/blog/2020/04/07/bookdown-learnings/#5-how-to-deploy-a-preview-of-the-book-for-pull-requests).
30-
31-
### Notes for associate editors
32-
33-
If you're an associate editor, you can also push directly to `main` for small fixes. We shall use PRs to `main` for discussing larger updates.
34-
35-
If you're an associate editor and you want to render the book locally you need to install Quarto and the other dependencies stated in [DESCRIPTION](DESCRIPTION) in particular use `pak::pak("bergant/airtabler")`, and [get and store an Airtable API key following their instructions](https://github.com/bergant/airtabler#get-and-store-the-api-key) (if you're not an editor, you don't have access to our Airtable base). Then use `bookdown::render_book('index.Rmd', 'bookdown::gitbook')` and the book will be generated in the `_book` folder; you can open the book on the command line by doing `open _book/index.html`.
36-
37-
# Meta
38-
39-
This book was started using [Sean Kross](https://github.com/seankross)' [minimal bookdown example](https://github.com/seankross/bookdown-start).
40-
41-
All of the content of this repository is licensed
42-
[CC-BY-SA](https://creativecommons.org/publicdomain/zero/1.0/).
43-
44-
You can cite this book using [its Zenodo metadata and DOI](https://doi.org/10.5281/zenodo.2553043).
45-
12+
See [contributing guide](.github/CONTRIBUTING.md).

booknews.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NEWS {#booknews}
22

3-
## dev (0.9.0)
3+
## 0.9.0
44

55
- 2024-01-09, update roxygen2 wording (`@vincentvanhees`, #792).
66

custom.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ code {
2323
.summaryblock > a {
2424
color: #d8dfee;
2525
}
26+
27+
.quarto-title-meta {
28+
display: block !important;
29+
}

index.Rmd

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,7 @@
88
#| echo: false
99
#| results: 'asis'
1010
#| warning: false
11-
#| eval: fase
12-
cat("\n```bibtex\n")
13-
u <- "https://zenodo.org/record/2553043" # universal URL redirects to latest
14-
s <- rvest::session(u)
15-
u <- paste0(s$url, "/export/bibtex") # redirected
16-
out <- rvest::read_html(u)
17-
bibentry <- rvest::html_text(out)
18-
cat(bibentry)
19-
cat("\n```\n")
11+
source(file.path("scripts", "zenodo.R"), local = knitr::knit_global())
2012
```
2113

2214
You can also read the [PDF version](/ropensci-dev-guide.pdf) of this book.

index.es.Rmd

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,13 @@
22

33
<a href="https://doi.org/10.5281/zenodo.2553043"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.2553043.svg?branch=master" alt="DOI"></a>
44

5-
<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/3.0/us/deed.es"><img alt="Licencia Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png" /></a><br /> Esta obra está bajo [una Licencia Creative Commons Atribución-NoComercial-CompartirIgual 3.0 Estados Unidos de América](https://creativecommons.org/licenses/by-nc-sa/3.0/us/deed.es). Consulta [el DOI de Zenodo](https://doi.org/10.5281/zenodo.2553043) para saber como citarla.
6-
7-
8-
```{r}
9-
#| eval: fase
10-
#| echo: false
11-
#| results: 'asis'
12-
#| warning: false
13-
cat("\n```bibtex\n")
14-
u <- "https://zenodo.org/record/2553043" # universal URL redirects to latest
15-
s <- rvest::session(u)
16-
u <- paste0(s$url, "/export/hx") # redirected
17-
out <- rvest::read_html(u)
18-
bibentry <- rvest::html_text(rvest::html_element(out, "pre"))
19-
cat(bibentry)
20-
cat("\n```\n")
5+
<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/3.0/us/deed.es"><img alt="Licencia Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png" /></a><br /> Esta obra está bajo [una Licencia Creative Commons Atribución-NoComercial-CompartirIgual 3.0 Estados Unidos de América](https://creativecommons.org/licenses/by-nc-sa/3.0/us/deed.es). Consulta [el DOI de Zenodo](https://doi.org/10.5281/zenodo.2553043) de la version original y [el DOI de la traducción](https://zenodo.org/doi/10.5281/zenodo.10797248) para saber como citarlas.
6+
7+
Ejemplo:
8+
9+
```
10+
rOpenSci editorial team (2024). Paquetes rOpenSci: Desarrollo, mantenimiento y revisión por pares [rOpenSci Packages: Development, Maintenance, and Peer Review] (Traducción al español: Yanina Bellini Saibene, Elio Campitelli, Paola Corrales) Zenodo. https://zenodo.org/doi/10.5281/zenodo.10797248 (Trabajo original publicado en 2024)
11+
2112
```
2213

2314
También puedes leer la [versión PDF de este libro](/ropensci-dev-guide.pdf).

index.pt.Rmd

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,11 @@
44

55
<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/3.0/us/"><img alt="Licença Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png" /></a><br /> Este trabalho está licenciado com uma licença [Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License](https://creativecommons.org/licenses/by-nc-sa/3.0/us/). Utilize o [Zenodo DOI](https://doi.org/10.5281/zenodo.2553043) para citar esta obra.
66

7-
```{r}
8-
#| eval: fase
7+
```{r}
98
#| echo: false
109
#| results: 'asis'
1110
#| warning: false
12-
cat("\n```bibtex\n")
13-
u <- "https://zenodo.org/record/2553043" # universal URL redirects to latest
14-
s <- rvest::session(u)
15-
u <- paste0(s$url, "/export/hx") # redirected
16-
out <- rvest::read_html(u)
17-
bibentry <- rvest::html_text(rvest::html_element(out, "pre"))
18-
cat(bibentry)
19-
cat("\n```\n")
11+
source(file.path("scripts", "zenodo.R"), local = knitr::knit_global())
2012
```
2113

2214
Você também pode ler a [versão em PDF](/ropensci-dev-guide.pdf) deste livro.

0 commit comments

Comments
 (0)