doc: update concept syntax

This commit is contained in:
Artemy Egorov 2024-08-09 19:40:31 +03:00
parent 4258f3296d
commit 559badea25
2 changed files with 44 additions and 37 deletions

View file

@ -21,12 +21,13 @@ This is Daleth (high level language that compiles to Daletl).
```yaml ```yaml
# multilines # multilines
# #
# `text` - input is trimmed with indent # {text} - input is trimmed with indent
# #
# `~n text` - n is number of minimum spaces to add after trimming with indent # {~n text} - n is number of minimum spaces to add after trimming with indent
# for each line # for each line
# #
# `# text` - input not modified # {#text} - input not modified
#
# #
# tag syntax # tag syntax
# #
@ -37,43 +38,52 @@ This is Daleth (high level language that compiles to Daletl).
# tag [ multiple tags body ] # tag [ multiple tags body ]
# #
# Arguments # Arguments
# tag(argument) # tag argument
# #
# Tags without body and argument also supported # Tags without body and argument also supported
#
#
# custom no tag syntax
#
# {-text} - paragraph, text indent is trimmed
# [[tags]] - element tag with body of multiple tags
# text - element tag with text body
meta(title): Daleth syntax concept meta "title": Daleth syntax concept
meta(description): This document describes Daleth syntax and some tags meta "description": This document describes Daleth syntax and some tags
h(1): TxtDot revolution h1: TxtDot revolution
p: TxtDot is a cool project p: TxtDot is a cool project
# If no tag is specified, then the 'el' tag is placed # If no tag is specified, then the 'el' tag is placed
This is element This is element
br br
# if no tag is specified but a '{}' is present, then the 'p' tag is placed # if no tag is specified but a '{- text}' is present, then the 'p' tag is placed
# '\n' is deleted only in this format. If a break line is needed in a paragraph, use ' \n'. # '\n' is deleted in this format. If a break line is needed in a paragraph, use ' \n'.
{ {-
Check Dalet too Check Dalet too
This is one paragraph This is one paragraph
} }
{ This is another paragraph } {- This is another paragraph ({- text\}) }
# ( ) 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
] ]
] ]
# [] for multiple tags # [] for multiple tags
row [ row [
[ # if no tag is specified but a '[[]]' is present, then the 'el' tag
h(2): Features # with multiple tags body placed
[[
h2: Features
ul [ ul [
Server-side page simplification Server-side page simplification
@ -86,14 +96,13 @@ row [
Some kind of Material Design 3 Some kind of Material Design 3
Customization with plugins, see @txtdot/sdk and @txtdot/plugins Customization with plugins, see @txtdot/sdk and @txtdot/plugins
] ]
]]
] [[
h2: Running
[ [[
h(2): Running h3: Dev
[
h(3): Dev
# {} for multiline strings, indent is automatically trimmed # {} for multiline strings, indent is automatically trimmed
code { code {
@ -102,31 +111,29 @@ row [
} }
# {~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
[[
h3: Production
code { code {
npm install npm install
npm run build npm run build
npm run start npm run start
} }
] ]]
[
h(3): Docker
[[
h3: Docker
code: docker compose up -d code: docker compose up -d
] ]]
] ]]
] ]
# Table has custom format if text used # Table has custom format if text used

View file

@ -367,7 +367,7 @@ bq: I am Blockquote
| name | footlnk | | name | footlnk |
| id | 19 | | id | 19 |
| body | no | | body | no |
| argument | text , number | | argument | text, number |
Link to footnote. Link to footnote.