Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission to CRAN: size of documentation #259

Open
bryanhanson opened this issue Aug 10, 2020 · 2 comments
Open

Submission to CRAN: size of documentation #259

bryanhanson opened this issue Aug 10, 2020 · 2 comments
Labels
Priority: 3-low Topic: documentation 📘 Related to hyperSpec's (non-vignette) documentation. Use a separate dag for vignettes. Topic: vignette 📗 Related to vignettes of hyperSpec
Milestone

Comments

@bryanhanson
Copy link
Collaborator

bryanhanson commented Aug 10, 2020

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 bryanhanson added Topic: documentation 📘 Related to hyperSpec's (non-vignette) documentation. Use a separate dag for vignettes. Priority: 3-low Topic: vignette 📗 Related to vignettes of hyperSpec labels Aug 10, 2020
@bryanhanson bryanhanson added this to the Version 1.0 milestone Aug 10, 2020
@GegznaV
Copy link
Collaborator

GegznaV commented Aug 10, 2020

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

@bryanhanson
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 3-low Topic: documentation 📘 Related to hyperSpec's (non-vignette) documentation. Use a separate dag for vignettes. Topic: vignette 📗 Related to vignettes of hyperSpec
Projects
None yet
Development

No branches or pull requests

2 participants