From 47ba29bc14cb51eb7b0a80af320a6adf534a2833 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 29 Mar 2023 02:38:17 +0200 Subject: [PATCH] docs: Document additions to the node format --- demos/node-editor/node-format.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/demos/node-editor/node-format.md b/demos/node-editor/node-format.md index e769865887..b174662f32 100644 --- a/demos/node-editor/node-format.md +++ b/demos/node-editor/node-format.md @@ -6,15 +6,25 @@ The format is a text format that follows the [CSS syntax rules](https://drafts.c The grammar of a node text representation using [the CSS value definition syntax](https://drafts.csswg.org/css-values-3/#value-defs) looks like this: **document**: `\*` -**node**: container { } | ` { * }` +**node**: container [ "name" ] { } | ` [ "name" ] { * }` | "name" **property**: `: | ;` -Each node has its own `` and supports a custom set of properties, each with their own `` and syntax. The following paragraphs document each of the nodes and their properties. +Each node has its own `` and supports a custom set of properties, each with their own `` and syntax. The following paragraphs document each of the nodes and their properties. When serializing and the value of a property equals the default value, this value will not be serialized. Serialization aims to produce an output as small as possible. To embed newlines in strings, use \A. To break a long string into multiple lines, escape the newline with a \. +# Names + +### Nodes + +Nodes can be given a name by adding a string after the `` in their definition. That same node can then be used further down in the document by specifying just the name identifying the node. + +### Textures + +Just like nodes, textures can be referenced by name. When definining the named texture, the name has to be placed in front of the URL. + # Nodes ### container -- 2.30.2