feat: rust create abstractions, tag enum, fix serde; update daletpack, daletl specs

This commit is contained in:
Artemy Egorov 2024-08-01 15:51:59 +03:00
parent d5ba86f251
commit 1611820661
9 changed files with 355 additions and 93 deletions

View file

@ -10,8 +10,7 @@ Mime type: `application/dalet-pack`
## Types
- **Null**
- **Integer**
- **Integer** (2)
- **String** (5)
- **Tag array**
- **Tags** (4)
@ -22,7 +21,7 @@ Mime type: `application/dalet-pack`
## Limitations
- a value of integer (4 bits) must be between 0 and 15
- a value of integer must be between 0 and 255
- maximum byte size of a String object is (2^32)
- string must be encoded in UTF-8
- maximum number of elements of a tag array object is (2^32)
@ -33,8 +32,8 @@ Mime type: `application/dalet-pack`
| name | id | id-bits |
| ------------------------ | --- | ------- |
| null | 0 | 0000 |
| int | 1 | 0001 |
| int 4 | 0 | 0000 |
| int 8 | 1 | 0001 |
| str 3 | 2 | 0010 |
| str 4 | 3 | 0011 |
| str 8 | 4 | 0100 |
@ -64,22 +63,20 @@ variable number of objects stored in DaletPack format:
+~~~~~~~~~~~~~~~~~+
| |
+~~~~~~~~~~~~~~~~~+
```
### Null format
```txt
+--------+
| 0000 |
+--------+
X - unknown bit
```
### Integer format
```txt
+--------+------+
| 0001 | XXXX |
| 0000 | XXXX |
+--------+------+
+--------+----------+
| 0001 | XXXXXXXX |
+--------+----------+
```
### String format
@ -88,7 +85,7 @@ variable number of objects stored in DaletPack format:
str 3 (up to 8 bytes):
+--------+-----+=========+
| 0010 | XXX | utf-8 |
+--------+-----+========+
+--------+-----+=========+
str 4 (up to 16 bytes):
+--------+------+=========+

View file

@ -117,15 +117,15 @@ ol: {
## 6. Row
| Property | Description |
| -------- | ---------------------- |
| name | row |
| id | 6 |
| body | tags |
| argument | (optional); start, end |
Splits the text into rows. The alignment argument specifies how the items inside the row are aligned. By default it is aligned to the center.
| Property | Description |
| -------- | ---------------------------- |
| name | row |
| id | 6 |
| body | tags |
| argument | optional; start, center, end |
Splits the text into rows. The alignment argument specifies how the items inside the row are aligned. By default it is aligned to the start.
m
**Daleth example**:
```txt
@ -151,7 +151,7 @@ end -> 1
| -------- | ----------- |
| name | link |
| id | 7 |
| body | text, tags |
| body | any |
| argument | string |
Link to other sites. On click the link opens in new tab.
@ -168,7 +168,7 @@ link[https://example.com]: I am Link
| -------- | ----------- |
| name | navlink |
| id | 8 |
| body | text, tags |
| body | any |
| argument | string |
Link to the same site. On click the link opens in current tab.
@ -185,7 +185,7 @@ navlink[/specification]: I am Navlink
| -------- | ----------- |
| name | btn |
| id | 9 |
| body | text,tags |
| body | any |
| argument | string |
Same as link, but with button style.
@ -202,7 +202,7 @@ btn[https://example.com]: I am Button
| -------- | ----------- |
| name | navbtn |
| id | 9 |
| body | text,tags |
| body | any |
| argument | string |
Same as navlink, but with button style.
@ -479,12 +479,12 @@ disc[Click to expand]: I am Disclosure
## 26. Block
| Property | Description |
| -------- | ----------- |
| name | bl |
| id | 26 |
| body | text, tags |
| argument | start, end |
| Property | Description |
| -------- | ----------------------------- |
| name | bl |
| id | 26 |
| body | text, tags |
| argument | optional; start, center, end |
Creates block element. Can be used for aligning. By default aligned to center.