Skip to content

Commit

Permalink
Simplify vignette precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
slager committed Feb 11, 2024
1 parent 7160ae5 commit a28c3b7
Show file tree
Hide file tree
Showing 14 changed files with 168 additions and 527 deletions.
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ README.Rmd
travis-tool.sh
cran-comments.md
Makefile
vignettes/
appveyor.yml
^cran-comments\.md$
^revdep$
Expand All @@ -22,3 +21,6 @@ revdep/library.noindex
^\.github$
^README\.Rmd$
^codecov\.yml$
^doc$
^Meta$
^vignettes/figure$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
revdep/checks.noindex
revdep/data.sqlite
revdep/library.noindex
inst/doc
/doc/
/Meta/
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ Imports:
ggplot2,
maps
Suggests:
knitr,
rmarkdown,
testthat,
vcr
vcr,
withr
RoxygenNote: 7.3.1
X-schema.org-applicationCategory: Data Access
X-schema.org-keywords: species, occurrences, biodiversity, maps, vertnet, mammals, mammalia, specimens
X-schema.org-isPartOf: "https://ropensci.org"
VignetteBuilder: knitr
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
RSCRIPT = Rscript --no-init-file

all: move rmd2md

move:
cd inst/vign;\
cp rvertnet.md ../../vignettes;\
cp -rf figure/* ../../vignettes/figure/

rmd2md:
cd vignettes;\
mv rvertnet.md rvertnet.Rmd
vignette:
${RSCRIPT} vignettes/precompile.R

test:
${RSCRIPT} -e 'library(methods); devtools::test()'
Expand Down
Binary file removed inst/vign/figure/unnamed-chunk-11-1.png
Binary file not shown.
Binary file removed inst/vign/figure/unnamed-chunk-13-1.png
Binary file not shown.
333 changes: 0 additions & 333 deletions inst/vign/rvertnet.md

This file was deleted.

Binary file removed man/figures/unnamed-chunk-11-1.png
Binary file not shown.
Binary file removed man/figures/unnamed-chunk-13-1.png
Binary file not shown.
1 change: 1 addition & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
Binary file added vignettes/figure/vertmap-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions vignettes/precompile.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Vignettes that depend on internet access have been precompiled:

withr::with_dir('vignettes', knitr::knit("rvertnet.Rmd.orig", "rvertnet.Rmd"))

devtools::build_vignettes()
311 changes: 138 additions & 173 deletions vignettes/rvertnet.Rmd

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions inst/vign/rvertnet.Rmd → vignettes/rvertnet.Rmd.orig
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<!--
%\VignetteEngine{knitr::knitr}
%\VignetteIndexEntry{rvertnet introduction}
%\VignetteEncoding{UTF-8}
-->
---
title: Introduction to rvertnet
author: Scott Chamberlain
date: "2020-01-28"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Introduction to rvertnet}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, eval=TRUE, echo=FALSE}
knitr::opts_chunk$set(
Expand All @@ -13,9 +18,6 @@ knitr::opts_chunk$set(
)
```

rvertnet introduction
=====================

`rvertnet` is a client for interacting with [VertNet.org](http://vertnet.org/).

## Installation
Expand Down Expand Up @@ -98,7 +100,7 @@ res$data

Pass output of `vertsearch()` to a map

```{r fig.width=8, fig.height=4}
```{r, vertmap, fig.width=8, fig.height=4, fig.cap = ""}
out <- vertsearch(tax = "(mustela nivalis OR mustela erminea)")
vertmap(out)
```
Expand Down

0 comments on commit a28c3b7

Please sign in to comment.