preprocessor: Apply the preprocessor to a resource.

Description Usage Arguments Details Value Note See Also

Description

Hand in hand with parsers, preprocessors are the heart of director. The idea is to allow the developer to do any additional stuff prior to sourcing an R file. For example, if some helper functions are desired or some operators should be overloaded for a DSL (domain-specific language), the preprocessor can perform this prior to sourcing the R file.

Usage

1
preprocessor(object, ..., parse. = TRUE)

Arguments

object

active_resource. See active_resource.

...

additional parameters to pass to the next layer in the resource parsing tower.

parse.

logical. Whether or not to apply the parser to the resource. If FALSE, this is equivalent to sourcing the resource's file without running its parser. By default, TRUE.

Details

To define a preprocessor for routes in a given path, you can use the register_preprocessor method on the director object.

Value

The parsed resource if parse. = TRUE, and the preprocessed resource otherwise.

Note

The parameters must be named object and ... due to this method's inclusion in a tower.

See Also

register_preprocessor, active_resource, tower


syberia/director documentation built on May 30, 2019, 10:40 p.m.