name = { first = "Tom", last = "Preston-Werner" }
point = { x = 1, y = 2 }
animal = { type.name = "pug" }
TOML Tables
Inline Table
Ignore whitespace
[a.b.c] # this is best practice
[ d.e.f ] # same as [d.e.f]
[ g . h .i ] # same as [g.h.i]
[ j . "Ê" .'l' ] # same as [j."Ê".'l']
Array-like
[[comments]]
author = "Nate"
text = "Great Article!"
[[comments]]
author = "Anonymous"
text = "Love it!"
#â Equivalent JSON
{
"comments" : [
{
"author" : "Nate",
"text" : "Great Article!"
},
{
"author" : "Anonymous",
"text" : "Love It!"
}
]
}
Nested
[table1]
foo = "bar"
[table1.nested\_table]
baz = "bat"
Basic
[name]
foo = 1
bar = 2
foo
and bar
are keys in the table called name
Comments