# When package is changed, one should rerun this code to regenerate
# the vignette. To change the vignette source code, change
# trac-example.Rmd.orig, not trac-example.Rmd (which is generated by
# running the code below).
# Using the approach described in
# https://ropensci.org/blog/2019/12/08/precompute-vignettes/
library(tidyverse)
library(knitr)
knit("trac-example.Rmd.orig", output = "trac-example.Rmd")
system("mv figure/* .; rmdir figure")
txt <- read_file("trac-example.Rmd") %>%
str_replace_all("\\(figure/", "(")
write_file(txt, file = "trac-example.Rmd")
rmarkdown::render("trac-example.Rmd")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.