Skip to contents

This function will serve your lesson and it will auto-update whenever you save a file.


serve(path = ".")



the path to your lesson. Defaults to the current path.


the output of servr::httw(), invisibly. This is mainly used for its side-effect


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().

See also

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.