build_analysis_site() is a wrapper for pkgdown::build_site_github_pages() that adds an
'Analysis' menu containing rendered versions of all .Rmd files in analysis/.
Arguments
- pkg
Path to package. Currently, only
pkg = "."is supported.- ...
additional arguments passed to
pkgdown::build_site_github_pages()(not implemented)
Details
When run, build_analysis_site():
Reads base pkgdown::pkgdown settings from
pkgdown/_base.ymlWrites base settings to
_pkgdown.ymlCreates a template using
pkgdown::template_navbar()and inserts ananalysismenu with links to html versions of each .Rmd file inanalysis/Writes the template to
_pkgdown.ymlUpdates
README.mdby runningdevtools::build_readme()(ifREADME.Rmdexists) to update the list of notebooksRuns
pkgdown::build_site_github_pages()withinstall = TRUEandnew_process = TRUECreates a
_site.ymlfile based on the final_pkgdown.ymlthat clones the pkgdown::pkgdown navbar in a temporary build directoryCopies the following from
analysis/into the build directory:*.Rmd,assets/,data/,import/,rendered/Changes
*.Rmdfromhtml_notebooktohtml_documentusingto_document()Builds a site using
rmarkdown::render_site()using modifiedhtml_documentoutput settings to render files with the look and feel ofhtml_notebookMoves 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.
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().
Supported File Types
While build_quarto_site() supports both R Markdown (.Rmd) and Quarto (.qmd) notebooks in
the analysis directory interchangeably, build_analysis_site() supports .Rmd files only.
