From 2ee8e26622e28e1908a37492b1f5aa9cec1b60c5 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 16 Nov 2011 23:44:04 +0100 Subject: Fixed documentation (again -.-) --- docu/language_definition.html | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'docu') diff --git a/docu/language_definition.html b/docu/language_definition.html index d0feb4e..1a633cc 100644 --- a/docu/language_definition.html +++ b/docu/language_definition.html @@ -95,11 +95,11 @@

Variable

-

Variables start with a $ or can be wrapped within ${ and }, so vou can write this: ${foo}ish

+

Variables start with a $ or can be wrapped within ${ and }, so you can write this: ${foo}ish

Variable have names, these names can consist of letters (english alphabet; upper and lower case), numbers and underscores (_). As a regex: [a-zA-Z0-9_]+

-

A variable can also be an array. To access an array, wrap the desired fieldname within [ and ]. A fieldname can be constructed of Text and othe Variables. So you can dynamically access fields: $foo[$bar]. These fieldnames can also be nested or concatenated: $foo[$bar[baz]][herp][$de[derp]]

+

A variable can also be an array. To access an array, wrap the desired fieldname within [ and ]. A fieldname can be constructed of Text and other Variables. So you can dynamically access fields: $foo[$bar]. These fieldnames can also be nested or concatenated: $foo[$bar[baz]][herp][$de[derp]]

If you want a literal $ char, you can escape it: \$

-

Variables in STE T/PL are typeless, everything ist text. In a boolean context, empty text usually represents false, else true.

+

Variables in STE T/PL are typeless, everything is text. In a boolean context, empty text usually represents false, else true.

Tag

A Tag can be compared to a function. A Tag can have parameters and children elements.

@@ -112,11 +112,11 @@

If the tag is self-closing, the last char is a / (e.g.: ]]>).

If the tag is a closing one, the first char is a /. An opening Tag does not have a /.An example of an opening-closing Tag pair wrapping the text bar: bar]]>

- Parameters of a tag consists of a name and the corresponding value (wrapped in " or ') seperated by an = .
- Parameters are seperated by any whitespace (space, tab or newline) char.
+ Parameters of a tag consists of a name and the corresponding value (wrapped in " or ') separated by an = .
+ Parameters are separated by any whitespace (space, tab or newline) char.
Parameter values can consist of Text and Variable elements but not of Tags!
If you need a literal " or ' in a parameter value, you can escape them: \" or \' .
- When using variables in paramter values, they will be "replaced" by their value. Because many tags need the variable and not its content, they expect only the variable's name. If you then write foo="$bar", the tag will not operate on the bar variable but on the Variable with the name stored in $bar! So read the instructions to the tag carefully! + When using variables in parameter values, they will be "replaced" by their value. Because many tags need the variable and not its content, they expect only the variable's name. If you then write foo="$bar", the tag will not operate on the bar variable but on the Variable with the name stored in $bar! So read the instructions to the tag carefully!

Example: de ]]>

@@ -167,25 +167,25 @@ \~ ~ Text elements - More info: short comparasions + More info: short comparisons \{ { Text elements - More info: short if-clause, short comparasions + More info: short if-clause, short comparisons \} } Text elements - More info: short if-clause, short comparasions + More info: short if-clause, short comparisons \| | Text elements - More info: short if-clause, short comparasions + More info: short if-clause, short comparisons \\ @@ -218,7 +218,7 @@

Short syntax for if-clause

Because if-clauses are used often, there is an short syntax:

?{condition|then|else}

-

This is equavilent to:

+

This is equivalent to:

conditionthenelse]]>

?, {, | and } can be escaped

In this variant, the else part is not optional!

@@ -237,7 +237,7 @@ (where x is either a or b).

- The operator is passed wth the op parameter. Following parameters are available: + The operator is passed with the op parameter. Following parameters are available: @@ -273,7 +273,7 @@

-

If the comparasion was true, a non-empty text will be returned, otherwise an empty text, so you can use ste:cmp with ste:if

+

If the comparisons was true, a non-empty text will be returned, otherwise an empty text, so you can use ste:cmp with ste:if

Example:


@@ -286,11 +286,11 @@
 			

Short syntax for if-clause

Because comparisons are used often, there is an short syntax:

~{a|operator|b}

-

This is equavilent to:

+

This is equivalent to:

]]>

~, {, | and } can be escaped

Because this is implemented as a simple substitution, you can only use Text and Variables. And " must be escaped.

-

WARNING: short comparasions can not be nested! They can be inside short if-clauses, but not the other way around!

+

WARNING: short comparisons can not be nested! They can be inside short if-clauses, but not the other way around!

ste:not

The ste:not Tag will logically invert its content. If it is an empty text (i.e. false), it will return a non-empty text (i.e. true) and vice versa.

@@ -399,7 +399,7 @@

ste:infloop

-

Create an infinitive loop. You can get out of the loop using the ste:break tag. Can be used to emulate othe loop constructs like while loops.

+

Create an infinitive loop. You can get out of the loop using the ste:break tag. Can be used to emulate other loop constructs like while loops.

Example:


@@ -419,7 +419,7 @@
 			

When this self-closing tag is called, the current loop(ste:for, ste:foreach, ste:infloop) will go to the next iteration, aborting the current iteration.

ste:load

-

This self-closing tag loads and executes anoter template. The name parameter (mandatory) defines the template to load.

+

This self-closing tag loads and executes another template. The name parameter (mandatory) defines the template to load.

Because each template must be parseable and transcompilable by itself, this is not a inclusion of another template. So you can not do this:

slave.tpl:
@@ -477,7 +477,7 @@

ste:calc

-

To perform mathematical calculations, you can use ste:math. ste:math calculates the mathematical formula it is wrapped around and returns the result. The formula is in the usual infix-notation [ext. Link] and has these operators: +, -, *, / and ^. Numbers are always decimal, the decimal mark is . and numbers can be prefixed with an - to indicate a negative number. It is a good idea to wrap a negative number in brackets to prevent wrong evaluation (because - is also an operator). Calculations can be grouped with brackets: ( and ).

+

To perform mathematical calculations, you can use ste:calc. ste:calc calculates the mathematical formula it is wrapped around and returns the result. The formula is in the usual infix-notation [ext. Link] and has these operators: +, -, *, / and ^. Numbers are always decimal, the decimal mark is . and numbers can be prefixed with an - to indicate a negative number. It is a good idea to wrap a negative number in brackets to prevent wrong evaluation (because - is also an operator). Calculations can be grouped with brackets: ( and ).

Real numbers are supported, complex numbers not.

Formulas are evaluated at runtime, not during transcompilation.

@@ -488,7 +488,7 @@

ste:mktag

ste:mktag allows you to define own Tags using STE T/PL.

-

The parameter name (mandatory) expects the name of the new tag. If your tag requires some parameters, you can specify them using the optional mandatory parameter. Names of the mandatory parameters are seperated by |.

+

The parameter name (mandatory) expects the name of the new tag. If your tag requires some parameters, you can specify them using the optional mandatory parameter. Names of the mandatory parameters are separated by |.

The Variable _tag_parameters (associative array) will hold all given parameters and their values.

With the ste:tagcontent tag you can execute the tags content.

ste:mktag will be transcompiled like any other code. So your custom tag will be almost as fast as a plugin coded in PHP.

@@ -500,7 +500,7 @@ - * 2 + * 2 $i
@@ -517,7 +517,7 @@

Standard Library

The Standard Library contains some useful tags, which are not builtin but still always available.

ste:escape

-

Escapes characters that are reserved for HTML (e.g. <, >, ", &). The text to escape ist the tag's content. +

Escapes characters that are reserved for HTML (e.g. <, >, ", &). The text to escape is the tag's content.

Example:

Foo & bar...]]>
@@ -535,7 +535,7 @@

Increments (i.e. add 1) a variable (variable name given by parameter var).

ste:dec

-

Decrements (i.e. substract 1) a variable (variable name given by parameter var).

+

Decrements (i.e. subtract 1) a variable (variable name given by parameter var).

ste:date

Formats a time using PHPs strftime format [ext. Link]. The format is given in the tag's content. You can specify a time (unix timestamp) using the timestamp parameter (defaults to the current time).

-- cgit v1.2.3-70-g09d2