hyperSpec icon indicating copy to clipboard operation
hyperSpec copied to clipboard

Submission to CRAN: size of documentation

Open bryanhanson opened this issue 5 years ago • 2 comments

This is an early warning about an issue that may arise when submitting to CRAN. It may apply to other packages in the hySpc.* series as well. By the time we split everything out, this problem may disappear, but I'm doubtful. I discovered this when updating my own package ChemoSpec.

When I build, check and install locally I get the following notice:

  • checking installed package size ... NOTE installed size is 6.9Mb sub-directories of 1Mb or more: doc 5.3Mb

In order to compact the size of the documentation so the package is below the CRAN limit, we may have to make the following change in each vignette's yaml:

output:
#    bookdown::html_document2: # use for pkgdown site
    bookdown::pdf_document2: # use for CRAN to keep size down
      toc: yes
      toc_depth: 2
      fig_caption: yes
      number_sections: true # needed for section cross-refs to work

In my testing, nothing breaks in the vignettes by making this change. This means that a user doing browseVignettes will be offered the pdf version. Users will have to discover the html versions another way.

This change will only be needed when packaging for CRAN, and should be changed back to html_document2 when the CRAN submission is complete.

Apparently there is a lot of formatting code when html_document2 is used, and of course the graphics are in-lined too.

For another CRAN submission issue see #275

bryanhanson avatar Aug 10 '20 12:08 bryanhanson

Yes, this is the issue I'm not aware of how to solve. E.g., in this check on MacOS:

image

On other OS'es the size is also above 5 MB.

I tried to change the figure sizes in the vignettes, but this didn't seem to have much effect.

But is it really the solution to use PDF version of the vignettes? Couldn't anything else be done to have a smaller package size with HTML vignettes?


Related

I've updated the vignettes to use:

output:
    bookdown::html_vignette2

that is a recently created feature in bookdown, which is a shortcut for:

output:
    bookdown::html_ducument2:
        base_format: rmarkdown::html_vignette

GegznaV avatar Aug 10 '20 14:08 GegznaV

I had the same experience with changing the size of the figures -- it did not make much difference. I'm not sure what the alternatives are, but the pdf version of the vignettes looks just fine. We'll have to keep our eyes open for options.

bryanhanson avatar Aug 10 '20 15:08 bryanhanson