JSON Module Docs

JSON serves as the middle ground between header files and module files. It has just as much control as a module file, while being easier to read

{
    "settings": {
        //...
    },
    "types": {
        //...
    },
    "structs": {
        //...
    },
    "start": {
	//...
    }
    "nodes": {
        //...
    }
}

Settings

The settings area contains settings about the language that can be changed, such as separator, and the main documentation link

"settings": {
    "doc-link": "https://link-to-documentation-root",
    "separator": ";\n",
    ...
}

See the module file docs for more info on the settings

Types

These are the building-block types, stuff like int, and bool

"types": {
    "bool": {
        "letter": "b",
        "icon": "circle-thin",
        "connect-icon": "circle",
        "colour": "#FF0000",
        "format": "%",
        "tag": "checkbox"
    },
    "float": {
        "letter": "f",
        "icon": "circle-thin",
        "connect-icon": "circle",
        "colour": "#00FF00",
        "format": "%f",
        "tag": "number"
    },
    ...
}

Name

Name of the type

Letter

The id that the editor uses to build nodes, it can be anything but I'd recommend using a letter

Icon

The Font Awesome 4 Icon to use on unconnected nubs

Connect-Icon

The Font Awesome 4 Icon to use on connected nubs

Colour

Colour that represents that type, it will influence the icon, gradients, and lines connecting nubs

Format

The format for the input value, where % will be replaced. To make a string type you would put in "%"

Tag

Type attribute for the input tag to make values

Structs

"structs": {
    "Vector": {
        "colour": "#0000FF",
        "static": false,
        "properties": {
            "x": {
                "type": "float",
                "permissions": "rw",
                "link": "placeholder"
            },
            "y": {
                "type": "float",
                "permissions": "rw",
                "link": "placeholder"
            },
            "z": {
                "type": "float",
                "permissions": "rw",
                "link": "placeholder"
            }
        },
        "methods": {
            "GetLength": {
                "io": {
                    "inputs": {},
                    "outputs": {
                        "": "float"
                    }
                },
                "link": "placeholder"
            }
        },
        "link": "placeholder"
    }
}

Name

Name of the struct

Colour

Colour to represent the struct

Static

If true, the editor will make a Get node for the struct's name, If false, the editor will create New and Break nodes

Properties

Array of properties, check the module file docs for more info on them

Methods

Array of methods, Check the nodes section for more info on the IO

Link

Documentation link for the struct, to be appended to the link in the settings

Start

The start section is the same as the Nodes section, except that each of those nodes will spawn when a new document is created.

Nodes

Because there are bound to be a ton of nodes, There are many ways to write them and you can choose speed vs readability.

So, it's very free-form, you can insert things in either JSON format or module file format via string.

"nodes": {
    // First way: 100% JSON
    "If": {
        "type": "1",
        "format": "if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2",
        "io": {
            "inputs": {
                "": "exec",
                "Condition": "bool"
            },
            "outputs": {
                "True": "exec",
                "False": "exec",
                "Then": "exec"
            },
        },
        "link": "placeholder"
    },

    // Second way: The IO can be given in the module file format
    "If": {
        "type": "1",
        "format": "if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2",
        "io": "e.;b.Condition;o.;e.True;e.False;e.Then;",
        "link": "placeholder"
    },

    // Third way: The whole node can be given in the module file format, either through a string or array
    "If": [
        "1",
        "if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2",
        "e.;b.Condition;o.;e.True;e.False;e.Then;",
        "placeholder"
    ],

    "If": "1, if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2, e.;b.Condition;o.;e.True;e.False;e.Then;, placeholder"
}

Name

Name of the node

Type

Number defining the type.

  • - 0: Execution Node
    The first input and output are execution nubs. The first input is not included and the first output continues the code.
  • - 1: Normal Node
    All inputs are included, but it also doesn't automatically continue
  • - 3: Input Node
    Type 3 means there's an input tag somewhere on the node, and that's where the output comes from

Output

The output of the node, where %0 will be replaced with the first parameter, %1 with the second, and so on.

%o0 is the first output, %o1 is the second output and so on.

%c is the same as %o except it doesn't indent.

%s is the same as %c except it stops after the first node, and there's no separator

IO

The syntax for each nub is type.name;

Type is the letter code given in the types section

o.; splits the inputs and outputs, so to create a node with one execution input and a boolean output, it would be:

e.NameOfExec; o.; b.NameOfBool;

But you can't have spaces between nubs so it would be squished together like

e.NameOfExec;o.;b.NameOfBool;

The name can be left empty, in which case it would just be type.;

Nubs can have modifiers put at the beginning to change the nub

n.e.ExecNub;
  • - n: Means that the nub will contribute to the lighting and gradient, but won't appear on the node
  • - i: The nub will be replaced with the input tag for that type
  • - c: Only the nub's name will appear, so you can put a custom nub in there
  • - p: Denotes an optional nub, it needs a default value so it looks like p.3.f.Number;
  • - a: Array. The nub accepts more than one input, so it will have a + button to add more nubs

Doc-Link

The doc-link is appended onto the main link provided in the settings section to get the full documentation link about the node

Check out the Python module as an example