role-model / roleR

R package implementing the RoLE model
https://role-model.github.io/roleR
GNU General Public License v3.0
1 stars 2 forks source link

How to re-build the docs site #46

Open diazrenata opened 1 year ago

diazrenata commented 1 year ago

(all of this while in the roleR .Rproj)

  1. Update documentation. Warnings are OK, but it needs to be fixed if it actually fails.

    devtools::document()
  2. Update the docs dir locally. This will render the site and launch a preview of it in your local web browser.

pkgdown::build_site()

This can fail if any of the vignettes refuse to build. For example, when I run it currently, I get an error from the use_cases vignette:

> pkgdown::build_site()
-- Installing package into temporary library ----------------
== Building pkgdown site =======================================================
Reading from: '/Users/renatadiaz/Documents/GitHub/roleR'
Writing to:   '/Users/renatadiaz/Documents/GitHub/roleR/docs'
-- Initialising site -----------------------------------------------------------
-- Building home ---------------------------------------------------------------
Writing '404.html'
-- Building function reference -------------------------------------------------
Reading 'man/createRolePredModel.Rd'
Reading 'man/div-sumStats.Rd'
Reading 'man/getFinalState.Rd'
Reading 'man/getSumStats.Rd'
Reading 'man/localComm.Rd'
Reading 'man/metaComm.Rd'
Reading 'man/raw-sumStats.Rd'
Reading 'man/roleData.Rd'
Reading 'man/roleExperiment.Rd'
Reading 'man/roleModel.Rd'
Reading 'man/roleParams.Rd'
Reading 'man/rolePhylo.Rd'
Reading 'man/runRole.Rd'
Reading 'man/setExpMetadata.Rd'
Reading 'man/writeRoLE.Rd'
-- Building articles -----------------------------------------------------------
Reading 'vignettes/roleR_intro.Rmd'
Reading 'vignettes/roleR_use_cases.Rmd'
-- RMarkdown error -------------------------------------------------------------
--------------------------------------------------------------------------------
Error in render_rmarkdown(pkg, input = input, output = output_file, output_format = format,  : 
  Failed to render RMarkdown
Caused by error:
! error in callr subprocess
Caused by error:
! assignment of an object of class "logical" is not valid for slot 'neut_delta' in an object of class "roleParams"; is(value, "numeric") is not TRUE
In addition: Warning messages:
1: Failed to parse example for topic 'roleExperiment' 
2: Failed to parse example for topic 'roleModel' 
3: Failed to parse example for topic 'roleParams' 
4: Failed to parse example for topic 'runRole' 
Error: 
! error in callr subprocess
Caused by error in `render_rmarkdown(pkg, input = input, output = output_file, output_format = format, …`:
! Failed to render RMarkdown
Caused by error:
! error in callr subprocess
Caused by error:
! assignment of an object of class "logical" is not valid for slot 'neut_delta' in an object of class "roleParams"; is(value, "numeric") is not TRUE
Type .Last.error to see the more details.

This will go away if we fix the error ! assignment of an object of class "logical" is not valid for slot 'neut_delta' in an object of class "roleParams"; is(value, "numeric") is not TRUE in the use_cases vignette. For now I taped over it by setting eval = FALSE for the entire vignette.

  1. Commit local changes and push

  2. Actions will take over rendering the website from the files in the docs directory.

jidec commented 1 year ago

Just pushed a fix for the bug in the use_cases vignette, devtools::document() followed by pkgdown::build_site() should now run without error