build_analysis_site | R Documentation |
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/
.
build_analysis_site(pkg = ".", ...)
pkg |
Path to package. Currently, only |
... |
additional arguments passed to |
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 an analysis
menu with
links to html versions of each .Rmd file in analysis/
Writes the template to _pkgdown.yml
Updates README.md
by running devtools::build_readme()
(if README.Rmd
exists) to update
the list of notebooks
Runs pkgdown::build_site_github_pages()
with install = TRUE
and new_process = TRUE
Creates a _site.yml
file based on the final _pkgdown.yml
that clones the pkgdown navbar
in a temporary build directory
Copies the following from analysis/
into the build directory: *.Rmd
, assets/
, data/
,
import/
, rendered/
Changes *.Rmd
from html_notebook
to html_document
using to_document()
Builds a site using rmarkdown::render_site()
using modified html_document
output settings
to render files with the look and feel of html_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.
rmarkdown _site.yml as yaml, invisibly
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()
.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.