Manage Environment Variables for a piece of content.

get_environment(content)

set_environment_new(env, ...)

set_environment_remove(env, ...)

set_environment_all(env, ...)

Arguments

content

An R6 Content object as returned by content_item()

env

An R6 Environment object as returned by get_environment()

...

name = value pairs of environment variable names and values

Details

get_environment() returns an Environment object for use with "setter" methods

set_environment_new() updates environment values (either creating new values or updating existing). Set NA as the value to remove a variable.

set_environment_remove() is a wrapper on set_environment_new() that allows removing named / listed variables quickly

set_environment_all() sets all environment variable values (will remove variables not specified)