2024-07-23 13:57:22 +03:00
|
|
|
# Daletl specification for Dalet v1.0-preview
|
|
|
|
|
|
|
|
## Data format
|
|
|
|
|
2024-07-27 17:44:34 +03:00
|
|
|
Daletl must be serialized as [DaletPack](./daletpack.md). All data transfer between server and client is done in this format.
|
2024-07-23 13:57:22 +03:00
|
|
|
|
|
|
|
### Root
|
|
|
|
|
|
|
|
Daletl root is array of tags. For convenience, we will use the json5 representation of the data.
|
|
|
|
|
|
|
|
```json5
|
|
|
|
[]
|
|
|
|
```
|
|
|
|
|
|
|
|
### Tag
|
|
|
|
|
|
|
|
All tags specification is in [Tags](./tags.md).
|
|
|
|
|
2024-07-25 15:55:09 +03:00
|
|
|
Each tag may be one of four types:
|
2024-07-24 16:41:50 +03:00
|
|
|
|
|
|
|
#### Data Representation
|
|
|
|
|
2024-07-27 17:44:34 +03:00
|
|
|
##### As array of 1-3 elements
|
2024-07-23 13:57:22 +03:00
|
|
|
|
|
|
|
1. Tag id
|
2024-07-27 17:44:34 +03:00
|
|
|
2. Tag body (optional if argument is null)
|
2024-07-23 13:57:22 +03:00
|
|
|
3. Tag argument (optional)
|
|
|
|
|
|
|
|
Tag id is integer number.
|
|
|
|
|
2024-07-24 16:41:50 +03:00
|
|
|
Body can be only a string, null, array of tags or tag (equals to array of tags with 1 tag).
|
2024-07-23 13:57:22 +03:00
|
|
|
|
|
|
|
Argument can be number or string.
|
|
|
|
|
2024-07-24 16:41:50 +03:00
|
|
|
###### Heading example
|
2024-07-23 13:57:22 +03:00
|
|
|
|
|
|
|
```json5
|
|
|
|
[1, "This is heading", 1]
|
|
|
|
```
|
|
|
|
|
2024-07-24 16:41:50 +03:00
|
|
|
###### Unordered list example
|
2024-07-23 13:57:22 +03:00
|
|
|
|
|
|
|
```json5
|
|
|
|
[
|
|
|
|
4,
|
|
|
|
[
|
|
|
|
[0, "Item 1"],
|
|
|
|
[0, "Item 2"],
|
|
|
|
],
|
|
|
|
]
|
|
|
|
```
|
2024-07-24 16:41:50 +03:00
|
|
|
|
|
|
|
##### As string
|
|
|
|
|
|
|
|
String becomes element tag.
|
|
|
|
|
|
|
|
```json5
|
|
|
|
"Element"
|
|
|
|
```
|
|
|
|
|
|
|
|
equals to
|
|
|
|
|
|
|
|
```json5
|
|
|
|
[0, "Element"]
|
|
|
|
```
|
|
|
|
|
|
|
|
##### As array of tags
|
|
|
|
|
|
|
|
If array not started with a number. The implication is that this turns into an “element” tag
|
|
|
|
|
|
|
|
```json5
|
|
|
|
["Element", [1, "Heading"]]
|
|
|
|
```
|
|
|
|
|
|
|
|
equals to
|
|
|
|
|
|
|
|
```json5
|
|
|
|
[
|
|
|
|
0,
|
|
|
|
[
|
|
|
|
[0, "Element"],
|
|
|
|
[1, "Heading"],
|
|
|
|
],
|
|
|
|
]
|
|
|
|
```
|