make: Serve files under a directory based on GNU Make

View source: R/make.R

makeR Documentation

Serve files under a directory based on GNU Make

Description

You can define how and when to rebuild files (such as R Markdown files) using Make rules, e.g. a rule _posts/%.md: _source/%.Rmd with a command to build ‘.Rmd’ to ‘.md’ will be executed if and only if ‘foo.Rmd’ is newer than ‘foo.md’. The exit status of the command make -q will decide whether to rebuild files: rebuilding occurs only when the exit code is not 0. When an HTML file has been rebuilt, it will be automatically refreshed in the web browser.

Usage

make(dir = ".", ...)

Arguments

dir

The root directory to serve.

...

Server configurations passed to server_config().

Note

You must have installed GNU Make to use this function. This is normally not a problem for Linux and OS X users (it should be available by default). For Windows users, you can either install GNU Make, or just install Rtools, which also contains GNU Make.

Examples

# some built-in examples (if you are not familiar with make, you can take a
# look at the Makefile of each example)
servr::serve_example("make1", servr::make)
servr::serve_example("make2", servr::make)

servr documentation built on May 29, 2024, 2:07 a.m.

Related to make in servr...