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 settings from
pkgdown/_base.yml
Writes base settings to
_pkgdown.yml
Creates a template using
pkgdown::template_navbar()
and inserts ananalysis
menu with links to html versions of each .Rmd file inanalysis/
Writes the template to
_pkgdown.yml
Updates
README.md
by runningdevtools::build_readme()
(ifREADME.Rmd
exists) to update the list of notebooksRuns
pkgdown::build_site_github_pages()
withinstall = TRUE
andnew_process = TRUE
Creates a
_site.yml
file based on the final_pkgdown.yml
that clones the pkgdown navbar in a temporary build directoryCopies the following from
analysis/
into the build directory:*.Rmd
,assets/
,data/
,import/
,rendered/
Changes
*.Rmd
fromhtml_notebook
tohtml_document
usingto_document()
Builds a site using
rmarkdown::render_site()
using modifiedhtml_document
output settings to render files with the look and feel ofhtml_notebook
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.
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.