THT is in early Beta. We welcome contributors & feedback.

JCON

JCON (JSON for CONfiguration) is a configuration format that supports nested data.

The line-based parser makes it easier for humans to read and edit than regular JSON.

See the Jcon module for parsing methods.

JCON can also be embedded as a template function.

A Quick Look

{
    myKey: {
        key: this is a string
        flag: true
        list: [
            this is item 1
            this is item 2
        ]
        multiline: '''
            This is a
            multiline
            string
        '''
    }
}

Annotated Format

// Comments take up one entire line

// Wrap the data in a Map or List
{
    // Keys are always un-quoted, separated by a colon,
    // followed by a value or a lone brace
    myKey: {

        // Strings are not quoted
        subKey: this is a string

        // One key/value per line.  No end commas.
        subKey2: another string

        // Multiline strings with triple-quote
        multiKey: '''
            This is a
            multiline
            string
        '''

        // Lists have one item per line.  No end commas.
        list: [
            this is item 1
            this is item 2
        ]

        // 'true' and 'false' are converted to Flags
        flag: true

        // Keys with the 'Lite' suffix are automatically
        // parsed as Litemark
        bodyLite: '''

            ## My Favorite Quote

            > Wherever you go, there you are.

        '''

        // Use backslash to escape characters
        escapeMe: \{ some text \}
    }
}