Skip to contents

Convert list to a string vector that represents of TOML. Each item of the vector represents a line of the TOML file.

Usage

list2toml(x)

Arguments

x

a named list

Value

a string vector representing individual lines of TOML representation of x.

Details

list2toml process structured lists recursively by first processing any non-list members and then processing remaining items of the list type using another call of lit2toml. In these calls, the name of the item is used as a parent_name.

Examples

config = list(
    "xml" = list("chunk" = "<xml>{{tag}}</xml>"),
    "templates" = list(),
    "defaults" = list("tag" = "Just another tag in the TOML!")
     )
list2toml(config)
#> [1] "[xml]"                                  
#> [2] "chunk = \"<xml>{{tag}}</xml>\""         
#> [3] ""                                       
#> [4] "[templates]"                            
#> [5] ""                                       
#> [6] "[defaults]"                             
#> [7] "tag = \"Just another tag in the TOML!\""
#> [8] ""