serve | R Documentation |
This function will serve your lesson and it will auto-update whenever you save a file.
serve(path = ".")
path |
the path to your lesson. Defaults to the current path. |
sandpaper::serve()
is an entry point to working on any lesson using The
Carpentries Workbench. When you run this function, a preview window will
open either in RStudio or your browser with an address like localhost:4213
(note the number will likely be different). When you make changes to files
in your lesson, this preview will update automatically.
When you are done with the preview, you can run servr::daemon_stop()
.
the output of servr::httw()
, invisibly. This is mainly used for its
side-effect
build_lesson()
, render the lesson once, locally.
if (FALSE) { # create an example lesson tmp <- tempfile() create_lesson(tmp, open = FALSE) # open the episode for editing file.edit(fs::path(tmp, "episodes", "01-introduction.Rmd")) # serve the lesson and begin editing the file. Watch how the file will # auto-update whenever you save it. sandpaper::serve() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.