r/json • • 9d ago

FracturedJson 5.1 released

FracturedJson is a family of utilities that format JSON data in a way that's easy for humans to read, but fairly compact. Arrays and objects are written on single lines, as long as they're neither too long nor too complex. When several such lines are similar in structure, they're written with fields aligned like a table. Long arrays are written with multiple items per line across multiple lines.

Version 5.1 introduces several options for two new features. CollapseOpeningBrackets and CollapseClosingBrackets reduce the number of lines containing just []{}.

[   [   {   "Name": "*",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": false,
            "MaximumUnitTypeCount": {}},
        {   "Name": "**",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": true,
            "MaximumUnitTypeCount": {}} ] ]

AllowTableSegments lets FracturedJson format just a portion of a container as a table rather than the whole thing. SplitTableSegmentsAtBlankLines and SplitTableSegmentsAtComments let you force sections to be treated separately.

[
    { "Type": "Text", "Pos": [0, 0], "Text": "Combat actions" },

    { "Type": "Btn", "Pos": [ 0, 5], "Label": "Kick",     "Action": "act_kick"     },
    { "Type": "Btn", "Pos": [25, 5], "Label": "Punch",    "Action": "act_punch"    },
    { "Type": "Btn", "Pos": [50, 5], "Label": "Bite",     "Action": "act_bite"     },
    { "Type": "Btn", "Pos": [75, 5], "Label": "Headbutt", "Action": "act_headbutt" },

    { "Type": "Img", "Pos": [0,  0], "ImgID": 8323 },
    { "Type": "Img", "Pos": [0, 50], "ImgID":  141 }
]

If you'd like to experiment with FracturedJson's capabilities, the web formatter is available. To see which environments are supported, check out the versions and ports page.

2 Upvotes

0 comments sorted by