From: Benjamin Otte Date: Wed, 29 Mar 2023 00:38:17 +0000 (+0200) Subject: docs: Document additions to the node format X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~485^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=47ba29bc14cb51eb7b0a80af320a6adf534a2833;p=gtk4.git docs: Document additions to the node format --- 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