You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reducing package file size by reducing screenshot sizes (#119)
* Adding some notes on how to reduce image size for screenshots - coming from direct experience with pngquant
* updating bibliography upon executing bookdown::render_book()
---------
Co-authored-by: Marcel Ramos Pérez <[email protected]>
Copy file name to clipboardExpand all lines: general-package-development.Rmd
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ Do not use filenames that differ only in case, as not all file systems are case-
43
43
### Package size {#package-size}
44
44
45
45
The source package resulting from running `R CMD build` should occupy less than 5 MB on disk.
46
+
If your package includes (e.g. in the vignettes) some screenshots, this limit can be reached quite quickly. Their size can be reduced (often as much as 70%) in a lossy but quality-preserving manner by using tools such as [pngquant](https://pngquant.org/) (available as a command line utility and as a GUI on most systems).
Copy file name to clipboardExpand all lines: packages.bib
+15-12Lines changed: 15 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -3,30 +3,34 @@ @Manual{R-base
3
3
author = {{R Core Team}},
4
4
organization = {R Foundation for Statistical Computing},
5
5
address = {Vienna, Austria},
6
-
year = {2022},
6
+
year = {2024},
7
7
url = {https://www.R-project.org/},
8
8
}
9
9
10
10
@Manual{R-bookdown,
11
11
title = {bookdown: Authoring Books and Technical Documents with R Markdown},
12
12
author = {Yihui Xie},
13
-
year = {2022},
14
-
note = {https://github.com/rstudio/bookdown},
13
+
year = {2024},
14
+
note = {R package version 0.38,
15
+
https://pkgs.rstudio.com/bookdown/},
16
+
url = {https://github.com/rstudio/bookdown},
15
17
}
16
18
17
19
@Manual{R-knitr,
18
20
title = {knitr: A General-Purpose Package for Dynamic Report Generation in R},
19
21
author = {Yihui Xie},
20
-
year = {2022},
21
-
note = {R package version 1.41},
22
+
year = {2023},
23
+
note = {R package version 1.45},
22
24
url = {https://yihui.org/knitr/},
23
25
}
24
26
25
27
@Manual{R-rmarkdown,
26
28
title = {rmarkdown: Dynamic Documents for R},
27
-
author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
28
-
year = {2022},
29
-
note = {https://github.com/rstudio/rmarkdown},
29
+
author = {JJ Allaire and Yihui Xie and Christophe Dervieux and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
Copy file name to clipboardExpand all lines: shiny-apps.Rmd
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,10 @@ To set the name of an Rd document, use the `@name` tag in the Roxygen block:
146
146
}
147
147
```
148
148
149
+
Additionally, the vignette of a shiny app package might include some screenshots, either generated manually or programmatically.
150
+
If generated manually, developers can use tools such as [pngquant](https://pngquant.org/) (available as a command line utility and as a GUI on most systems) to reduce their size (about 70%) without too much loss of quality.
151
+
Programmatically generated screenshots can be realized by means of the [Webshot2](https://cran.r-project.org/package=webshot2) package, using the `webshot2::appshot()` function.
152
+
149
153
## Review
150
154
151
155
When reviewing a shiny app package, the reviewer should check that the package
0 commit comments