Skip to content

Commit 4ebd2e7

Browse files
Grammar and formatting changes
1 parent 7804a97 commit 4ebd2e7

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

doc/language.md

+17-16
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ A scriban code block may contain:
104104
{{if !name; name = "default"; end; name }}
105105
```
106106
107-
Inside a code block, except for the EOL after each statement, white spaces characters are not affecting the parsing. There is only one case where whitespace is used to disambiguate between an array indexer and an array initializer.
107+
In a code block, white space characters have no impact on parsing, with the exception of the end-of-line character following each statement. The only exception is when white space is used to distinguish between an array indexer and an array initializer.
108108
109-
Also, if a statement is an expression (but not an assignment expression), the result of the expression will be output to the rendering output of the template:
109+
Additionally, when a statement is an expression (but not an assignment expression), the result of the expression will be displayed in the template's output:
110110
111111
> **input**
112112
```scriban-html
@@ -138,7 +138,7 @@ You can still use a plain string with an EOL inside a code block `"\n"` or you c
138138
[:top:](#language)
139139
### 1.2 Text block
140140

141-
Otherwise, any text is considered as a **text block** and simply output as is
141+
Otherwise, any text is treated as a **text block** and is outputted without modification.
142142

143143
```
144144
Hello this is {{ name }}, welcome to scriban!
@@ -156,13 +156,14 @@ For example the following escape:
156156
> **input**: `{%{Hello this is {{ name }}}%}`
157157
> **output**: `Hello this is {{ name }}`
158158
159-
Any escape block can be also escaped by increasing the number of `%` in the starting and ending block:
159+
If you want to escape an escape block, you can increase the number of % in the starting and ending block:
160160
> **input**: `{%%{This is an escaped block: }%} here}%%}`
161161
> **output**: `This is an escaped block: }%} here`
162162
163163
This allow effectively to nest escape blocks and still be able to escape them.
164164

165-
Hence a starting escape block `{%%%%{` will required an ending `}%%%%}`
165+
This allows for effective nesting of escape blocks and the ability to escape them.
166+
For example, a starting escape block {%%%%{ will require an ending }%%%%}"
166167

167168
[:top:](#language)
168169
### 1.4 Whitespace control
@@ -436,7 +437,7 @@ b.x
436437
[:top:](#language)
437438
### 4.2 The special variable `empty`
438439

439-
The `empty` variable represents simply an empty object. It is mainly relevant to be compatible with liquid, by providing a way to compare an object with the `empty` object to check if it is empty or not:
440+
The empty variable represents an empty object and is primarily used for compatibility with Liquid templates. It provides a way to compare an object with the empty variable to determine if it is empty or not:
440441

441442
> **input**
442443
```scriban-html
@@ -457,7 +458,7 @@ false
457458

458459
Scriban supports javascript like objects `{...}`
459460

460-
An object can be initialized empty :
461+
An object can be initialized empty:
461462

462463
`{{ myobject = {} }}`
463464

@@ -480,7 +481,7 @@ An object can be initialized with some members over multiple lines:
480481
}}
481482
```
482483

483-
Members of an object can be accessed:
484+
Members of an object can be accessed using dot notation or square bracket notation:
484485

485486
`{{ myobject.member1 }}` also equivalent to `{{ myobject["member1"] }}`
486487

@@ -530,7 +531,7 @@ false
530531
[:top:](#language)
531532
## 6 Arrays
532533

533-
An array can be initialized empty :
534+
An array can be initialized empty:
534535

535536
`{{ myarray = [] }}`
536537

@@ -622,7 +623,7 @@ a.size
622623
[:top:](#language)
623624
## 7 Functions
624625

625-
Scriban allows to define 4 kind of functions:
626+
Scriban allows for the definition of four different types of functions:
626627

627628
- Simple functions
628629
- Anonymous functions
@@ -631,7 +632,7 @@ Scriban allows to define 4 kind of functions:
631632

632633
### 7.1 Simple functions
633634

634-
The following declares a function `sub` that uses its first argument and subtract from it the second argument:
635+
The following declares a function `sub` that takes two arguments, `a` and `b`, and subtracts the value of `b` from `a`:
635636

636637
```
637638
{{func sub
@@ -1164,7 +1165,7 @@ Allows to start the iteration of the loop at the specified zero-based index:
11641165

11651166
##### The `limit` parameter
11661167

1167-
Allows to limit the iteration of the loop for the specified count
1168+
Limits the iteration of the loop to a specified count:
11681169

11691170
> **input**
11701171
```scriban-html
@@ -1180,7 +1181,7 @@ Allows to limit the iteration of the loop for the specified count
11801181

11811182
##### The `reversed` parameter
11821183

1183-
Allows to reverse the iteration on the elements
1184+
Reverses the iteration of the elements:
11841185

11851186
> **input**
11861187
```scriban-html
@@ -1211,7 +1212,7 @@ Like the `if` statement, the `expression` is evaluated to a boolean.
12111212
This function generates HTML rows compatible with an HTML table. Must be wrapped in an opening `<table>` and closing `</table>` HTML tags.
12121213

12131214
This statement is mainly for compatibility reason with the liquid `tablerow` tag.
1214-
It has overall the same syntax as a `for` statement (supporting the same parameters).
1215+
It uses similar syntax to a `for` statement (supporting the same parameters).
12151216

12161217
```
12171218
{{tablerow <variable> in <expression>}}
@@ -1404,7 +1405,7 @@ Note that variables declared outside the `with` block are accessible within.
14041405
[:top:](#language)
14051406
### 9.11 `include <name> arg1?...argn?`
14061407

1407-
The include is not a statement but actually a function that allows to parse and render the specified template name. In order to use this function, a delegate to an template loader must be setup on the [`TemplateOptions.TemplateLoader`](runtime.md#include-and-itemplateloader) property passed to the `Template.Parse` method.
1408+
`include` is not a statement but rather a function that allows you to parse and render a specified template. To use this function, a delegate to a template loader must be setup on the [`TemplateOptions.TemplateLoader`](runtime.md#include-and-itemplateloader) property passed to the `Template.Parse` method.
14081409

14091410
```
14101411
include 'myinclude.html'
@@ -1432,7 +1433,7 @@ The return statement is used to early exit from a top-level/include page or a fu
14321433

14331434
```
14341435
This is a text
1435-
{{~ ret ~}}
1436+
{{~ ret ~}}
14361437
This text will not appear
14371438
```
14381439

0 commit comments

Comments
 (0)