build_analysis_site: Build Analysis Site

View source: R/build.R

build_analysis_siteR Documentation

Build Analysis Site


build_analysis_site() is a wrapper for pkgdown::build_site() that adds an 'Analysis' menu containing rendered versions of all .Rmd files in analysis/.


build_analysis_site(pkg = ".", ...)



Path to package. Currently, only pkg = "." is supported.


additional arguments passed to pkgdown::build_site() (not implemented)


When run, build_analysis_site():

  1. Reads base pkgdown settings from pkgdown/_base.yml

  2. Writes base settings to _pkgdown.yml

  3. Creates a template using pkgdown::template_navbar() and inserts an analysis menu with links to html versions of each .Rmd file in analysis/

  4. Writes the template to _pkgdown.yml

  5. Updates by running devtools::build_readme() (if README.Rmd exists) to update the list of notebooks

  6. Runs pkgdown::clean_site() and pkgdown::build_site()

  7. Creates a _site.yml file based on the final _pkgdown.yml that clones the pkgdown navbar in a temporary build directory

  8. Copies the following from analysis/ into the build directory: *.Rmd, assets/, data/, import/, rendered/

  9. Changes *.Rmd from html_notebook to html_document using to_document()

  10. Builds a site using rmarkdown::render_site() using modified html_document output settings to render files with the look and feel of html_notebook

  11. Moves the rendered files to docs/: *.html, assets/, rendered/, without overwriting

build_analysis_site() will fail with an error if there are no files in analysis/*.Rmd, or if pkgdown/_base.yml does not exist.


rmarkdown _site.yml as yaml, invisibly

Continuous Integration

Both build_rdev_site() and build_analysis_site() are meant to be used as part of a CI/CD workflow, and temporarily set the environment variable CI == "TRUE" so that the build will fail when non-internal topics are not included on the reference index page per pkgdown::build_reference().

jabenninghoff/rdev documentation built on March 18, 2023, 9:31 p.m.