Skip to content

Commit 857c191

Browse files
maellefblpalmeirayabellini
authored
add more details on how to safeguard docs (#925)
* add more details on how to safeguard docs * add pt and es translation * Update pkg_ci.pt.Rmd Co-authored-by: Francesca Palmeira <[email protected]> * Apply suggestions from code review Co-authored-by: Yanina Bellini Saibene <[email protected]> * Update pkg_ci.es.Rmd --------- Co-authored-by: Francesca Palmeira <[email protected]> Co-authored-by: Yanina Bellini Saibene <[email protected]>
1 parent d6ff192 commit 857c191

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

booknews.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## dev version
44

5+
- 2025-07-09, add more details on how to safeguard docs building for rOpenSci packages (#910, `@rmgpanw`)
6+
57
- 2025-07-11, add mentions of tools useful for translation and localization (#812).
68

79
- 2025-07-09, add mention of tinytest. (#904)

pkg_ci.Rmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,24 @@ After transfer to rOpenSci's "ropensci" GitHub organization, each push to the re
117117

118118
After transfer to rOpenSci's "ropensci" GitHub organization, a pkgdown website will be built for your package after each push to the GitHub repo. You can find the status of these builds at `https://ropensci.r-universe.dev/ui#packages` and in the [commit status](https://ropensci.org/blog/2021/09/03/runiverse-docs/#how-it-works). The website build will use your pkgdown config file if you have one, except for the styling that will use the [`rotemplate` package](https://github.com/ropensci-org/rotemplate/).
119119

120+
If your documentation includes code that relies on, for instance, credentials, here's how to ensure pkgdown docs are rendered in the best possible way.
121+
122+
- For function examples, use the `examplesIf` roxygen2 tag with the `IN_PKGDOWN` variable e.g. `#' @examplesIf identical(Sys.getenv("IN_PKGDOWN"), "true")`
123+
- For vignettes, either pre-build if special tools/data/credentials are required which are unavailable on generic build servers (see https://ropensci.org/blog/2019/12/08/precompute-vignettes/), or use the `IN_PKGDOWN` variable with knitr eval option e.g.
124+
125+
```r
126+
knitr::opts_chunk$set(
127+
collapse = TRUE,
128+
comment = "#>",
129+
eval = Sys.getenv("IN_PKGDOWN") == "true"
130+
)
131+
```
132+
133+
Examples:
134+
135+
- `examplesIf`: https://github.com/ropensci/gtexr/blob/592ac781672f07eb67e935d4155570c5960d1fdb/R/get_service_info.R#L14 (see also Docs of the roxygen2 tag: https://roxygen2.r-lib.org/articles/rd.html?q=examplesIf#examples)
136+
- Vignette, knitr eval option: https://github.com/ropensci/gtexr/blob/592ac781672f07eb67e935d4155570c5960d1fdb/vignettes/gtexr.Rmd#L16
137+
120138
Please report bugs, questions and feature requests about the central builds and about the template at [https://github.com/ropensci-org/rotemplate/](https://github.com/ropensci-org/rotemplate/).
121139

122140

pkg_ci.es.Rmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,24 @@ Puedes encontrar el estado de este proceso en la URL `https://ropensci.r-univers
133133
El sitio web estará en `https://docs.ropensci.org/package_name` (por ejemplo [para `magick`](https://docs.ropensci.org/magick)).
134134
Si tu paquete tiene un archivo de configuración de pkgdown, rOpenSci docs lo usará para crear el sitio web, excepto para el tema, que se utilizará [`rotemplate` paquete](https://github.com/ropensci-org/rotemplate/).
135135

136+
Si tu documentación incluye código que depende, por ejemplo, de credenciales, aquí te explicamos cómo asegurarte de que los documentos pkgdown se representen de la mejor manera posible.
137+
138+
- Para los ejemplos de funciones, utiliza la etiqueta roxygen2 `examplesIf` con la variable `IN_PKGDOWN`, por ejemplo, `#' @examplesIf identical(Sys.getenv("IN_PKGDOWN"), "true")`.
139+
- Para viñetas, precompila si se requieren herramientas/datos/credenciales especiales que no están disponibles en servidores de compilación genéricos (consulta https://ropensci.org/blog/2019/12/08/precompute-vignettes/), o utilice la variable `IN_PKGDOWN` con la opción knitr eval, por ejemplo
140+
141+
```r
142+
knitr::opts_chunk$set(
143+
collapse = TRUE,
144+
comment = "#>",
145+
eval = Sys.getenv("IN_PKGDOWN") == "true"
146+
)
147+
```
148+
149+
Ejemplos:
150+
151+
- `examplesIf`:https://github.com/ropensci/gtexr/blob/592ac781672f07eb67e935d4155570c5960d1fdb/R/get_service_info.R#L14 (véase también la documentación de la etiqueta roxygen2: https://roxygen2.r-lib.org/articles/rd.html?q=examplesIf#examples)
152+
- Vignette, opción knitr eval:https://github.com/ropensci/gtexr/blob/592ac781672f07eb67e
153+
136154
Por favor, informa sobre errores, haz preguntas y solicita nuevas funcionalidades sobre este servicio y sobre la plantilla en [https://github.com/ropensci-org/rotemplate/](https://github.com/ropensci-org/rotemplate/).
137155

138156

pkg_ci.pt.Rmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ Após a transferência para a organização "ropensci" no GitHub pertencente a r
102102

103103
Após a transferência para a organização "ropensci" no GitHub pertencente a rOpenSci, um site pkgdown será criado para o seu pacote após cada envio para o repositório no GitHub. Você pode encontrar o status dessas compilações em `https://ropensci.r-universe.dev/ui#packages` e na seção [status do commit](https://ropensci.org/blog/2021/09/03/runiverse-docs/#how-it-works). A compilação do site usará seu arquivo config do pkgdown, se você tiver um, exceto para o estilo que usará o pacote [ `rotemplate`](https://github.com/ropensci-org/rotemplate/).
104104

105+
Se sua documentação incluir código que dependa, por exemplo, de credenciais, veja aqui como garantir que os documentos pkgdown sejam renderizados da melhor maneira possível.
106+
107+
- Para exemplos de funções, use a tag roxygen2 `examplesIf` com a variável `IN_PKGDOWN`, por exemplo, `#' @examplesIf identical(Sys.getenv(“IN_PKGDOWN”), “true”)`
108+
- Para vinhetas, pré-compile se forem necessárias ferramentas/dados/credenciais especiais que não estão disponíveis em servidores de compilação genéricos (consulte https://ropensci.org/blog/2019/12/08/precompute-vignettes/) ou use a variável `IN_PKGDOWN` com a opção knitr eval, por exemplo
109+
110+
```r
111+
knitr::opts_chunk$set(
112+
collapse = TRUE,
113+
comment =#>”,
114+
eval = Sys.getenv(“IN_PKGDOWN”) ==true
115+
)
116+
```
117+
118+
Exemplos:
119+
120+
- `examplesIf`:https://github.com/ropensci/gtexr/blob/592ac781672f07eb67e935d4155570c5960d1fdb/R/get_service_info.R#L14 (veja também a documentação da tag roxygen2: https://roxygen2.r-lib.org/articles/rd.html?q=examplesIf#examples)
121+
- Vignette, opção knitr eval: https://github.com/ropensci/gtexr/blob/592ac781672f07eb67e
122+
105123
Por favor, informe bugs, perguntas e solicitações de recursos sobre as compilações centrais e sobre o modelo em [https://github.com/ropensci-org/rotemplate/](https://github.com/ropensci-org/rotemplate/).
106124

107125

0 commit comments

Comments
 (0)