Title: | Modify TOML config files |
---|---|
Description: | Bindings to toml-edit to work with TOML data preserving comments and whitespace. |
Authors: | Jeroen Ooms [aut, cre] |
Maintainer: | Jeroen Ooms <jeroenooms@gmail.com> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-10-11 10:07:59 UTC |
Source: | https://github.com/jeroen/tomleditjs |
The toml_edit()
function modifies values in a TOML retaining order, comments,
and whitespace.
read_toml(file, as_json = FALSE) parse_toml(toml, as_json = FALSE) write_toml(x, auto_unbox = TRUE) edit_toml(toml, field, value)
read_toml(file, as_json = FALSE) parse_toml(toml, as_json = FALSE) write_toml(x, auto_unbox = TRUE) edit_toml(toml, field, value)
file |
path to file with toml text |
as_json |
return output as json string instead of R list |
toml |
string |
x |
vector or json string to convert to TOML |
auto_unbox |
convert atomic vectors of length 1 as scalars in TOML, unless
they are wrapped in |
field |
name of field to change, for example |
value |
new value of field to set. |
toml <- readLines('https://raw.githubusercontent.com/posit-dev/air/refs/heads/main/Cargo.toml') toml <- edit_toml(toml, 'workspace.package.rust-version', '1.84') toml <- edit_toml(toml, 'workspace.dependencies.bla', list(path = "./yolo", rev = "123"))
toml <- readLines('https://raw.githubusercontent.com/posit-dev/air/refs/heads/main/Cargo.toml') toml <- edit_toml(toml, 'workspace.package.rust-version', '1.84') toml <- edit_toml(toml, 'workspace.dependencies.bla', list(path = "./yolo", rev = "123"))