v0.2.0
Mdata is a textual key value file format.
Lines are separated by LF ("\n"
) characters.
Each line may contain a record.
The first "="
character separates the key from the value
i.e. keys cannot contain "="
characters, values can.
Whitespace is SPACE (" "
) and TAB ("\t"
).
Keys and values are trimmed of leading and trailing whitespace.
Records with empty keys are ignored i.e. can be used as comments.
Records without a "="
characters have an empty value.
These records may be used as tags.
Duplicate keys may trigger undefined behavior.
= mdata is a format for keys and values
key = value
= mdata can be formatted prettily
book
author = Joseph Heller
title = Catch-22
= The combination of tags (key only records)
= and ordinary records
= allow for a very nice manual editing experience
= and just make sense for metadata.
cool =
= comments are a nice implication of the format ignoring empty keys
= comments can be indented, since keys are trimmed
= empty lines are also an implication
Above Mdata is equivalent to the following JSON:
{
"key": "value",
"book": "",
"author": "Joseph Heller",
"title": "Catch-22",
"cool": ""
}
Best practises, habits, conventions.
A rudimentary Go implementation can be found at https://gitlab.com/datasha.re/mdata.