A helper function to query the fuse() context (such as the input file path or the output format name) when called inside a code chunk.

get_context(item = NULL)

Arguments

item

The name of the context item.

Value

If the item is provided, return its value in the context. If NULL, the whole context (an environment) is returned.

Examples

litedown::get_context("input")
#> NULL
litedown::get_context("format")
#> NULL
names(litedown::get_context())  # all available items
#> character(0)