kadyb / rgugik

Download datasets from Polish Head Office of Geodesy and Cartography
https://kadyb.github.io/rgugik/
Other
33 stars 4 forks source link

Prerender vignettes #29

Closed kadyb closed 4 years ago

kadyb commented 4 years ago

Can we prerender vignettes instead of building them with pkgdown? There is the same problem that requests from GitHub are blocked in functions orto_request and DEM_request. https://ropensci.org/technotes/2019/12/08/precompute-vignettes/

Second problem is that I added "--no-vignettes" argument to rcmdcheck, but still trying to build vignettes. I also removed "--as-cran" argument but without success.

Nowosad commented 4 years ago

Hi - I will take a look at in the next two days.

Nowosad commented 4 years ago

https://github.com/kadyb/rgugik/pull/30

kadyb commented 4 years ago

Log from rcmdcheck:

  • checking files in ‘vignettes’ ... NOTE The following directory looks like a leftover from 'knitr': ‘figure’
  • checking running R code from vignettes ... SKIPPED
  • checking re-building of vignette outputs ... SKIPPED

Log from pkgdown:

-- Building articles ---------------------------------------------------------- Writing 'articles/index.html' Reading 'vignettes/articles/geodb_description.Rmd' Writing 'articles/articles/geodb_description.html' Reading 'vignettes/orthophotomap.Rmd' Writing 'articles/orthophotomap.html' == DONE ========================================

kadyb commented 4 years ago

So, let's try:

Nowosad commented 4 years ago

Ad4 - try https://github.com/kadyb/rgugik/pull/31

kadyb commented 4 years ago

Related https://github.com/r-lib/pkgdown/issues/280

kadyb commented 4 years ago

It works but under the figures there are unnecessary captions like "plot of chunk unnamed-chunk-9".

Nowosad commented 4 years ago

I will try to make it work tomorrow.

Nowosad commented 4 years ago

https://github.com/kadyb/rgugik/pull/32

kadyb commented 4 years ago

Now we use stars instead of raster - rasters processing is immediate (use proxy).

kadyb commented 4 years ago

I suppose if we apply to CRAN, we will have to change vignettes to articles (so they won't generated by CRAN). It only takes to change the location of the files.

Nowosad commented 4 years ago

Why? Cannot we just submit as it is? (CRAN will only regerate .Rmd files which do not download anything)

kadyb commented 4 years ago

If so, OK. I thought we had to use source .Rmd files that are fully executable (with data downloading).

Nowosad commented 4 years ago

Nope. The whole idea now is to knit the .Rmd.orig file locally (before submitting to CRAN), which creates a new .Rmd file. This new file contains all data downloading results (nothing it being downloaded there).

kadyb commented 4 years ago

Next issues:

  1. I think this step in PRECOMPILE.R is unnecessary because we are building vignettes in pkgdown on GitHub Actions:

    library(devtools)
    build_vignettes()

    Right?

  2. Maybe before knit("vignettes/orthophotomap.Rmd.orig", "vignettes/orthophotomap.Rmd") we should use setwd() to save images in the same folder? This is not recommended, but we can try. More info.

  3. Also, we can try remove "--no-vignettes" argument from rcmdcheck and we'll see if it really works.

Nowosad commented 4 years ago
  1. Yep, you are probably right.
  2. I already tried opts_knit$set(root.dir = "vignettes/", but without any success.
  3. Fine by me.
kadyb commented 4 years ago

It seems to be working fine.

setwd("vignettes/")
knit("orthophotomap.Rmd.orig", "orthophotomap.Rmd")

I set it up in 94e12d4.