I have some top-level arrays that I want to treat similarly to top-level tables:
glyphs = [
{codepoint = 0x41, name = "A", file = "A.svg"},
{codepoint = 0x42, name = "B", file = "B.svg"},
{codepoint = 0x43, name = "C", file = "C.svg"},
]
ligatures = [
{ligature = "ff", name = "f_f", file = "f_f.svg"},
{ligature = "=>", name = "rocket_right", file = "rocket_right.svg"},
{ligature = "->", name = "arrow_right", file = "arrow_right.svg"},
]
[special-characters]
"=" = "equals"
"-" = "hyphen"
">" = "greater"
[metadata]
family = "Font Regular"
designer = "Me"
license = "CC0-1.0"
My concerns with this setup:
- Same-level arrays have to be physically grouped together; they can't be ordered logically, interspersed with tables. I'd like to order the information as in the following two examples -
metadata first, and special-characters before ligatures.
- Unlike table headers, array names can't show how nested they are globally. That would be especially helpful in the domain of font generation, where it can take a while to scroll past several arrays to find an absolute header.
- Array names read as assignments, not as headings. That means it's harder to express information hierarchy to the reader, and they're harder to skim for in large or unfamiliar files.
If I care strongly about these concerns, I can work around these disadvantages. For non-Latin scripts with very tall arrays, the following can be a usability improvement, despite the added code complexity:
[metadata]
family = "Font Regular"
designer = "Me"
license = "CC0-1.0"
[glyphs]
data = [
{codepoint = 0x41, name = "A", file = "A.svg"},
{codepoint = 0x42, name = "B", file = "B.svg"},
{codepoint = 0x43, name = "C", file = "C.svg"},
]
[special-characters]
"=" = "equals"
"-" = "hyphen"
">" = "greater"
[ligatures]
data = [
{ligature = "ff", name = "f_f", file = "f_f.svg"},
{ligature = "=>", name = "rocket_right", file = "rocket_right.svg"},
{ligature = "->", name = "arrow_right", file = "arrow_right.svg"},
]
But I'd prefer a syntax that doesn't introduce further nesting:
[metadata]
family = "Font Regular"
designer = "Me"
license = "CC0-1.0"
[glyphs][
{codepoint = 0x41, name = "A", file = "A.svg"},
{codepoint = 0x42, name = "B", file = "B.svg"},
{codepoint = 0x43, name = "C", file = "C.svg"},
]
[special-characters]
"=" = "equals"
"-" = "hyphen"
">" = "greater"
[ligatures][
{ligature = "ff", name = "f_f", file = "f_f.svg"},
{ligature = "=>", name = "rocket_right", file = "rocket_right.svg"},
{ligature = "->", name = "arrow_right", file = "arrow_right.svg"},
]
In short - TOML's headers are very useful, but they're awkward to apply to a domain that uses arrays heavily.
I have some top-level arrays that I want to treat similarly to top-level tables:
My concerns with this setup:
metadatafirst, andspecial-charactersbeforeligatures.If I care strongly about these concerns, I can work around these disadvantages. For non-Latin scripts with very tall arrays, the following can be a usability improvement, despite the added code complexity:
But I'd prefer a syntax that doesn't introduce further nesting:
In short - TOML's headers are very useful, but they're awkward to apply to a domain that uses arrays heavily.