Style Guide - Mrcarrot1/KarrotObjectNotation GitHub Wiki

The KON parser is relatively lax when it comes to formatting. However, there are three main ways in which KON should preferably be formatted for readability and style.

Style 1: Default

The default style is to place line breaks between most names, formatting characters, and elements, as follows:

Node
{
    item = foo
    item2 = bar
    Array [ foo; bar; ]
}

Style 2: Inline

The inline style does not use line breaks. It is comparable to inline JSON, which is typically used for web APIs.

Node { item = foo; item2 = bar; Array [ foo; bar; ] }

Style 3: All Line Breaks

This style is identical to the default syntax except in that arrays are not written as inline:

Node
{
    item = foo
    item2 = bar
    Array
    [
        foo
        bar
    ]
}

The following style should never be used:

Node {
    ...
}

Node and array names should be in either PascalCase or UPPER_SNAKE_CASE. Value names should be in camelCase.