Documents without namespace
STxT documents are text documents, with a structure of nested nodes. To determine the nesting level, tabs (or spaces) are used to indicate the nesting level. The documents will have the following characteristics:
- UTF-8 encoding
- Identifiers are CASE-INSENSITIVE. Spaces are allowed in names, but not
:
- Multiline nodes will be as follows:
:node name:
. This allows you to visually identify a final node that may consist of several lines - Comments: In STxT, comments are all lines that start with the
#
character
An example
Recipe: Macaroni recipe :Description: This is the description of the macaroni recipe. Bla, bla, bla Bla, bla, bla Servings: 3 Difficulty: easy Ingredients: Ingredient: (100g) Tomato Ingredient: (240g) Macaroni Steps: Step: (1) Make the sofrito Step: (2) Boil macaroni Step: (3) Mix macaroni with sofrito and serve
The same example with comments
Recipe: Macaroni recipe # (1) This is a comment # (2) This is also a comment # (3) This is also a comment :Description: :This is the description of the macaroni recipe. :Bla, bla, bla # (4) This is a comment :Bla, bla, bla # (5) this is NOT a comment Servings: 3 Difficulty: easy Ingredients: Ingredient: (100g) Tomato Ingredient: (240g) Macaroni Steps: Step: Make the sofrito Step: Boil macaroni Step: Mix macaroni with sofrito and serve
Here it should be noted that (1),(2),(3) and (4)
are comments, while
(5)
is not, since it is inside the indented text.
Nodes and indentation
An STxT document is a set of nested nodes.
Indentation is very similar to other languages, and you can use tabs or spaces.
4 spaces are equivalent to one tab
It is better not to mix documents with tabs and spaces
another characteristic is the following:
Levels must be consecutive
a level n
must be followed by n+1
,
with no jumps between them.
(Prefix) Central (Suffix)
Although it is not part of the language, it is common practice that
simple fields are structured with (prefix) central (suffix)
.
All 3 or only 1 or 2 of them may appear. Example:
Recipe: Macaroni recipe :Description: This is the description of the macaroni recipe. Bla, bla, bla Bla, bla, bla Servings: 3 Difficulty: easy Ingredients: Ingredient: (100g) Tomato Ingredient: (240g) Macaroni Steps: Step: Make the sofrito Step: Boil macaroni Step: Mix macaroni with sofrito and serve