In order to render a single modal window from R markdown to html, use the function generate_html_4_rmd(). The function expects the full path of the R markdown file to be rendered, such as in the following example:
generate_html_4_rmd(here::here("modals/tar.Rmd"))
To render all R markdown files in the “modals” directory to html, the function to use is render_all_rmd(). The R markdown files that need to be re-rendered most frequently contain interactive elements, as the data those elements draw from are frequently updated. Consequently, the function has the option of just re-rendering R markdown files that contain interactive elements
# Render all R markdown files in the modal directory
render_all_rmd("cinms")
# Render R markdown files in the modal directory that have interactive elements
render_all_rmd("cinms", interactive_only = T)
Satellite-derived data is displayed in several of the modal windows, such as in the following example:
# Warning: replacing previous import 'dplyr::collapse' by 'glue::collapse' when
# loading 'onmsR'
# Warning: replacing previous import 'magrittr::extract' by 'tidyr::extract' when
# loading 'onmsR'
This data and the resulting figures are auto-updated every month by calling infographiqR functions in Github Actions. In the case of the Channel Islands National Marine Sanctuary, the file that controls these actions can be found on GitHub here.