Skip to content

Commit

Permalink
Update vignette source files and precompile.R
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Oct 2, 2024
1 parent 5efc9d4 commit 5657d1e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 10 deletions.
12 changes: 7 additions & 5 deletions vignettes/a-getting-started.Rmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# Generated by vignettes/precompile.R: do not edit by hand.
# Please edit source in vignettes/source/_a-getting-started.Rmd
title: "Getting started with rphylopic"
output: rmarkdown::html_vignette
vignette: >
Expand All @@ -9,7 +11,7 @@ vignette: >

**Authors:** Lewis A. Jones & William Gearty

**Last updated:** 2024-09-03
**Last updated:** 2024-10-02



Expand Down Expand Up @@ -53,9 +55,9 @@ citation("rphylopic")
```
## To cite rphylopic in publications, use the following citation:
##
## Gearty, W. and Jones, L.A. 2023. rphylopic: An R package for fetching, transforming,
## and visualising PhyloPic silhouettes. Methods in Ecology and Evolution, 14(11),
## 2700-2708. doi: 10.1111/2041-210X.14221.
## Gearty, W. and Jones, L.A. 2023. rphylopic: An R package for fetching, transforming, and visualising
## PhyloPic silhouettes. Methods in Ecology and Evolution, 14(11), 2700-2708. doi:
## 10.1111/2041-210X.14221.
##
## A BibTeX entry for LaTeX users is
##
Expand Down Expand Up @@ -251,7 +253,7 @@ get_attribution(uuid = uuid, text = TRUE)
```

```
## Organism silhouettes are from PhyloPic (https://www.phylopic.org/; T. Michael Keesey, 2023) and were added using the rphylopic R package ver. 1.4.0.9000 (Gearty & Jones, 2023). Silhouette was made by Mareike C. Janiak, 2020 (Public Domain Mark 1.0). Silhouette was contributed by Mareike Janiak.
## Organism silhouettes are from PhyloPic (https://www.phylopic.org/; T. Michael Keesey, 2023) and were added using the rphylopic R package ver. 1.5.0 (Gearty & Jones, 2023). Silhouette was made by Mareike C. Janiak, 2020 (Public Domain Mark 1.0). Silhouette was contributed by Mareike Janiak.
```

## Save an image
Expand Down
4 changes: 3 additions & 1 deletion vignettes/b-advanced-ggplot.Rmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# Generated by vignettes/precompile.R: do not edit by hand.
# Please edit source in vignettes/source/_b-advanced-ggplot.Rmd
title: "Advanced examples in ggplot"
output: rmarkdown::html_vignette
vignette: >
Expand All @@ -9,7 +11,7 @@ vignette: >

**Authors:** William Gearty & Lewis A. Jones

**Last updated:** 2024-09-03
**Last updated:** 2024-10-02



Expand Down
4 changes: 3 additions & 1 deletion vignettes/c-advanced-base.Rmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# Generated by vignettes/precompile.R: do not edit by hand.
# Please edit source in vignettes/source/_c-advanced-base.Rmd
title: "Advanced examples in base R"
output: rmarkdown::html_vignette
vignette: >
Expand All @@ -9,7 +11,7 @@ vignette: >

**Authors:** William Gearty & Lewis A. Jones

**Last updated:** 2024-09-03
**Last updated:** 2024-10-02



Expand Down
23 changes: 20 additions & 3 deletions vignettes/precompile.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,31 @@ old_wd <- getwd()
setwd("vignettes/")

library(knitr)
knit("a-getting-started.Rmd.orig",
knit("./source/_a-getting-started.Rmd",
"a-getting-started.Rmd")
knit("b-advanced-ggplot.Rmd.orig",
knit("./source/_b-advanced-ggplot.Rmd",
"b-advanced-ggplot.Rmd")
knit("c-advanced-base.Rmd.orig",
knit("./source/_c-advanced-base.Rmd",
"c-advanced-base.Rmd")

library(devtools)
build_vignettes()

# x = vignette file name including file extension (e.g., "a-getting-started.Rmd")
read_only <- function(x) {
# Create file
tmp <- file(x)
# write lines
writeLines(c(c("---"),
c("# Generated by vignettes/precompile.R: do not edit by hand."),
paste0("# Please edit source in vignettes/source/_", x),
readLines(x)[2:length(readLines(x))]), tmp)
close(tmp)
}
# Add read only info
read_only("a-getting-started.Rmd")
read_only("b-advanced-ggplot.Rmd")
read_only("c-advanced-base.Rmd")
rm(read_only)

setwd(old_wd)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5657d1e

Please sign in to comment.