doc: update daleth concept

This commit is contained in:
Artemy Egorov 2024-08-07 15:54:57 +03:00
parent 94dc040a3d
commit b3261ef4c8
3 changed files with 61 additions and 29 deletions

View file

@ -19,24 +19,39 @@ Markup language ecosystem сombining small file size, big number of possibilitie
This is Daleth (high level language that compiles to Daletl). This is Daleth (high level language that compiles to Daletl).
```yaml ```yaml
# tag: body # tag syntax
# each line is a new tag (if not {}, () is used) #
# tag: text body
# tag (multiline text body)
# body text always trimmed # body text always trimmed
#
# tag { multiple tags body }
#
# Arguments
# tag[argument]
#
# Tags without body and argument also supported
meta[title]: Daleth syntax concept
meta[description]: This document describes Daleth syntax and some tags
h[1]: TxtDot revolution h[1]: TxtDot revolution
p: TxtDot is a cool project p: TxtDot is a cool project
# If no tag is specified, then the 'element' tag, the most primitive tag, is placed # If no tag is specified, then the 'paragraph' tag is placed
# () for block of text
( (
Check Dalet too Check Dalet too
This is one paragraph This is one paragraph
) )
This is another paragraph This is another paragraph
br
# [ ] for argument # [ ] for argument
row[center]: { row[center] {
link[https://github.com/txtdot/txtdot]: Homepage link[https://github.com/txtdot/txtdot]: Homepage
btn[https://example.com/donate]: { btn[https://example.com/donate] {
# tag without body # tag without body
img[https://example.com/donate.png] img[https://example.com/donate.png]
Donate Donate
@ -44,11 +59,11 @@ row[center]: {
} }
# {} for multiple objects # {} for multiple objects
row: { row {
{ {
h[2]: Features h[2]: Features
ul: { ul {
Server-side page simplification Server-side page simplification
Media proxy Media proxy
Image compression with Sharp Image compression with Sharp
@ -69,24 +84,24 @@ row: {
h[3]: Dev h[3]: Dev
# () for multiline strings, indent is automatically trimmed # () for multiline strings, indent is automatically trimmed
code: ( code (
npm install npm install
npm run dev npm run dev
) )
# (~n Text) n is number of minimum spaces # (~n Text) n is number of minimum spaces
code[markdown]: (~4 code[markdown] (~4
this is codeblock this is codeblock
) )
# (# Text) Text after "(# " not modified # (# Text) Text after "(# " not modified
code[markdown]: (# this is codeblock) code[markdown] (# this is codeblock)
} }
{ {
h[3]: Production h[3]: Production
code: ( code (
npm install npm install
npm run build npm run build
npm run start npm run start
@ -103,22 +118,22 @@ row: {
} }
# Table has custom format if text used # Table has custom format if text used
# +< cells > - primary column # +| cells | - primary column
# < cells > - secondary column # | cells | - secondary column
# < Element | Description > - converts to # | Element | Description | - converts to
# tcol: { # tcol {
# Element # Element
# Description # Description
# } # }
table: ( table (
+< Element | Description > +| Element | Description |
< h | Heading > | h | Heading |
< p | Paragraph > | p | Paragraph |
< img | Image > | img | Image |
< link | Link > | link | Link |
< btn | Button > | btn | Button |
< ul | Unordered list > | ul | Unordered list |
< br | Line break > | br | Line break |
+< quantity | 7 > +| quantity | 7 |
) )
``` ```

View file

@ -2,7 +2,7 @@
## Daletl ## Daletl
Daletl is data representation of serialized/deserialized [DaletPack](./daletpack.md). Daletl is data representation of deserialized [DaletPack](./daletpack.md).
### Page ### Page

View file

@ -481,7 +481,7 @@ disc[Click to expand]: I am Disclosure
| Property | Description | | Property | Description |
| -------- | ----------------------------- | | -------- | ----------------------------- |
| name | bl | | name | block |
| id | 26 | | id | 26 |
| body | text, tags | | body | text, tags |
| argument | optional; start, center, end | | argument | optional; start, center, end |
@ -491,7 +491,7 @@ Creates block element. Can be used for aligning. By default aligned to center.
**Daleth example**: **Daleth example**:
```yaml ```yaml
bl: I am Block block: I am Block
``` ```
Argument converts to numbers in daletl. Argument converts to numbers in daletl.
@ -549,6 +549,23 @@ Creates pre formatted text block. Like code but without style and highlight.
**Daleth example**: **Daleth example**:
```txt ```yaml
pre: I am pre pre: I am pre
``` ```
## 30. Metadata
| Property | Description |
| -------- | -------------- |
| name | meta |
| id | 30 |
| body | text |
| argument | text |
Not displayed. Specifies metadata such as title, description. Must be before all tags if specified.
**Daleth example**:
```yaml
meta[description]: I am description
```