A really simple PLAin Text Object Serialization library.
By default, the whole platos document is loaded as a single string.
platos | json |
---|---|
hello, world! more lines. | "hello, world!\nmore lines." |
Now add ***
to the head or the document:
platos | json |
---|---|
*** hello, world! more lines. | ["hello, world!", "more lines."] |
List can hold sublists:
platos | json |
---|---|
*** hello, world! more lines. * sublist item 1 sublist item 2 * subsublist item 1 subsublist item 2 * sublist item 5 | [ "hello, world!", "more lines.", [ "sublist item 1", "sublist item 2", ["subsublist item 1", "subsublist item 2"], [], "sublist item 5" ] ] |
Note the empty list there.
List items can be multiline text:
platos | json |
---|---|
*** $ * hello, world! $ more lines. * $ another multiline text as the first item of a sublist. second sublist item. | [ "* hello, world!", "more\nlines.", [ "another multiline\ntext as the first item\nof a sublist.", "second sublist item" ] ] |
Incase you need, here is a string starts with ***
platos | json |
---|---|
$$$ *** blablabla... more blablabla... | "***\nblablabla...\nmore blablabla..." |
And a string starts with $$$
:
platos | json |
---|---|
$$$ $$$ blablabla... more blablabla... | "$$$\nblablabla...\nmore blablabla..." |
Use %%%
to turn on dict mode:
platos | json |
---|---|
%%% name = jack age = 17 favorite food = fish, tomatos and milk. | {"name": "jack", "age": 17, "favorite food": "fish, tomatos\nand milk."} |
Dict as list items:
platos | json |
---|---|
% name = jack age = 17 % name = lucy age = 19 | [{"name": "jack", "age": 17}, {"name": "lucy", "age": 19}] |
like strings, but use #
, and be dropped by parser.
To prevent some indentions.
$$ EOF
some text
EOF
same on list with **
, and dict with %%
.