docs: Document additions to the node format
authorBenjamin Otte <otte@redhat.com>
Wed, 29 Mar 2023 00:38:17 +0000 (02:38 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 29 Mar 2023 01:53:52 +0000 (03:53 +0200)
demos/node-editor/node-format.md

index e769865887178a46c963e9b9256a8af8ed03269f..b174662f327f01cc2b6ad845f0f6e157544e7f0e 100644 (file)
@@ -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>\*`
-**node**: container { <document> } | `<node-name> { <property>* }`
+**node**: container [ "name" ] { <document> } | `<node-type> [ "name" ] { <property>* }` | "name"
 **property**: `<property-name>: <node> | <value> ;`
 
-Each node has its own `<node-name>` and supports a custom set of properties, each with their own `<property-name>` and syntax. The following paragraphs document each of the nodes and their properties.
+Each node has its own `<node-type>` and supports a custom set of properties, each with their own `<property-name>` 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 `<node-type>` 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