doc: add element and heading tags specification

This commit is contained in:
Artemy Egorov 2024-07-23 12:39:54 +03:00
parent 9841577297
commit e2d46a22f2
3 changed files with 77 additions and 16 deletions

View file

@ -1,8 +1,8 @@
<div align="center">
![dalet](./imgs/dalet.png)
![Dalet](./imgs/dalet.png)
# dalet
# Dalet
</div>
@ -12,17 +12,17 @@ Markup language ecosystem сombining small file size, big number of possibilitie
## Concept
This is daleth (high level language that translates to daletl).
This is Daleth (high level language that translates to Daletl).
```yaml
# tag: body
# each line is a new tag (if not {}, () is used)
h1: TxtDot revolution
h[1]: TxtDot revolution
p: TxtDot is a cool project
# If no tag is specified, then the 'element' tag, the most primitive tag, is placed
(
Check dalet too
Check Dalet too
This is one paragraph
)
@ -41,7 +41,7 @@ row[center]: {
# {} for multiple objects
row: {
{
h2: Features
h[2]: Features
ul: {
Server-side page simplification
@ -58,10 +58,10 @@ row: {
}
{
h2: Running
h[2]: Running
{
h3: Dev
h[3]: Dev
# () for multiline strings, indent is automatically trimmed
code: (
@ -79,7 +79,7 @@ row: {
}
{
h3: Production
h[3]: Production
code: (
npm install
@ -89,7 +89,7 @@ row: {
}
{
h3: Docker
h[3]: Docker
code: docker compose up -d
}

View file

@ -1,4 +1,4 @@
# Dalet
# Dalet v1.0-preview
> [!WARNING]
> Specification is not complete.
@ -9,20 +9,28 @@
### Daleth
**Daleth** is a high-level language for humans. It can be translated into daletl (to be explained later), but daletl cannot be translated into daleth[^1]. It is only used for page creation by humans.
**Daleth** is a high-level language for humans. It can be translated into daletl, but daletl cannot be translated into daleth[^1]. It is only used for page creation by humans.
### Daletl
**Daletl** is a low-level language for machines. It is used in data transmission, processing and generation. It is specifically optimized to transfer as little data as possible using json, messagepack or daletpack.
**Daletl** is a low-level language for machines. It is used in data transmission, processing and generation. It is specifically optimized to transfer as little data as possible using json, messagepack[^3] or daletpack[^2].
## Stages
### Stage 1 (optional)
In the first stage, the daleth language is parsed and converted to daletl. All tag names are replaced by the smallest possible names, so that they take up less space in json or messagepack, for example.
In the first stage, the daleth language is parsed and converted to daletl. All tag names are replaced by the smallest possible names, so that they take up less space in json or messagepack, for example. **This stage is not for data transmission**.
### Stage 2
At this stage, only daletl is used. This stage is used by programs for generation, modification and rendering. All information is transferred between the server and the client in this stage.
At this stage, only daletl is used. This stage is used by programs for generation, modification and rendering. The data is transferred between the server and the client only in this stage.
[^1]: In the first versions only. Detranslation is planned for the future.
## Specification
[Tags](./tags/main.md)
## References
[^1]: In the first versions only. Detranslation is planned for the future for the sake of devtools.
[^2]: Daletpack is not created and is not used at the moment. It is planned for the future.
[^3]: Daletl can be used through a variety of serialization formats.

View file

@ -0,0 +1,53 @@
# Tags specification for Dalet v1.0-preview
## Element
| Property | Description |
| ----------- | ----------- |
| Daleth name | element |
| Daletl name | e |
| Argument | no |
| Body | any |
Most primitive tag. Also used if no tag is specified.
Example:
```yaml
element: Dalet
element: { h[1]: Daleth }
Daletl
```
Daletl json5 data representation:
```json5
{ e: "Dalet" }
```
## Heading
| Property | Description |
| ----------- | ------------------- |
| Daleth name | h |
| Daletl name | h |
| Argument | int x; 1 <= x <= 10 |
| Body | text |
Heading is used for text formatting.
Example:
```yaml
h[1]: Dalet
h[2]: Daleth
h[3]: High level
h[2]: Daletl
h[3]: Low level
```
Daletl json5 representation:
```json5
{ h: "Dalet", l: 1 }
```