TemlCode Insertable
Insertable Markup Tags are designed to be a part of text flow. It's main purpose is to allow
user to define by a hand an insertion of eg. special characters, any UCS/Unicode characters,
structured informations like dates, math formulas, images, drawings or whole other documents
(by referencing).
Syntax of Insertable Tag
|
~( Insert [ ";" Insert ";" ... ";" Insert ] )
|
Insert
|
( ( Id & [Label] | Var ) + [Properties] ) | Cast | Deref | Sequence | Tilde
|
Insertable Tag can contain an unlimited number of consequenting elements separated by semicolon.
Each element can be either Entity, Cast, Dereference, Sequence or Tilde.
Entity
Entity represents some type of (text) rendering and it's parameters. It is up to the processing application,
how it will handle the rendering. Entity is there to tell, something of some meaning has to be inserted
at given position into the flow of text.
Entity must be named either with an Id with optional @Label part, or with #variable name. Parameters definition
is optional and is governed by the same syntax rules, as parameters in Properties Chapter.
If Entity is named with Id[@Label], it's scope of validity is inside of it's master Section. If it's defined
in White Space, scope of validity is from definition to the end of TemlCode stream. Labeled Entities can be
referenced for use in other TemlCode Markup Tags within the scope of validity.
If Entity is named with #variable, it usually means to insert the content of that variable at given
text flow position.
Syntax of Insertable Entity Tag
|
Id & [Label] | Var + [Properties]
|
Label
|
"@" & ( Name | StringFF )
& [ "." & ( Name | StringFF ) ]*
& [ ":" & ( Name | StringFF ) ]
|
Var
|
"#" & Id
|
Properties
|
< Parameter [ ";" Parameter ";" ... ";" Parameter [";"] ]>
|
TemlCode Example of Insertable Entities
|
~(nbsp) <- Non breaking space
~{#name = "John Smith" } ~(#name) <- insert content of #name
~(side_collumn <ref=bio@John.Smith>) <- insert whole John biography document as a side collumn text category
~(#name;nbsp;side_collumn <ref=bio@John.Smith>) <- ... all combined into one single Insertable Tag
~(text@"About Apple Fruit":version_015) <- direct section reference, should be rendered as insertion of whole document section under that reference
|
Cast
Cast explicitly indicates, in data formatting neutral form, what is the intention to do with the data it
embraces. This way it is possible to enter for example a date in neutral form, and let processing application
to render it according to the cultural backgrounds of given user. If cast type is already declared existing
type, casted data should conform to it's layout of fields definition.
Syntax of Insertable Cast Tag
|
( "&" & Id ) & ( "(" + Entries + ")" )
|
TemlCode Example of Insertable Entities & Casts
|
Leonardo da Vinci ~(pronunciation <file="L_da_Vinci.mp3">), ~(date@birth<d=15;m=4;y=1452>) - ~(date@death<d=2;m=5;y=1519>) was an Italian polymath, having been a scientist, mathematician, engineer, inventor, anatomist, painter, sculptor, architect, botanist, musician and writer.
... ~{&date=(day:int8u;month:int8u;year:int16)} He returned to Florence where he rejoined the Guild of St Luke on ~(&date(18,10,1503)), and spent two years designing and painting a great mural of The Battle of Anghiari for the Signoria.
... Leonardo died at Clos Lucé, France, on ~(date@death) at the age of ~(comp_years <from=date@birth;to=date@death>).
|
Dereference
Dereference is a way of accessing individual fields of record structures or arrays. Record fields
are accessed with full stop "." and name of field. Array elements are accessed through Indexes in
square brackets separated by a comma ",". Indexes are numbered from 0 to Size - 1 on each dimension.
Dereference accessors can nest to any depth according to the relevant data type declaration memory layout.
Dereferencing can be used on #variables and it usually means to insert the content of referenced record
or array field at given text flow position.
Syntax of Insertable Dereference Tag
|
"#" & Id &
(
[ "[" + ( Index | Deref
+ [ "," + Index | Deref ]* ) + "]" ]
& [ "." & Id ]*
)
|
TemlCode Example of Insertable Dereferences
|
~{&rgb = (red:int8u; green:int8u; blue:int8u); #gradient:&rgb[2 ] = [&rgb(0xFFD700),&rgb(0xDB7093)]}
The gradient components on the level of green channel range from ~(#gradient[0].green) <- 0xD7 to ~(#gradient[1].green) <- 0x70
Another way of accessing array & record field: ~(format <what=#gradient[1].red;how=hex;zeroalign=2>)
|
Sequence
Sequence is a consecutive definition of text data either in string form or in direct code point values.
String syntax is the classical one ".." where quotation mark itself (") is a part of string if entered
as "" (2x). Individual characters in string can be in the range of 0x20 .. 0x10FFFF,
control code values of 0x00 .. 0x1F are not allowed.
For characters with values greater than 0xFF an appropriate underlying encoding must be used.
Direct code point values can be entered either in %decimal or $hexadecimal notation. SBCS Ascii encoding
is sufficient to carry all %dec & $hex definitions. Code point values should be in the range of 0x00 .. 0x10FFFF
(Unicode range).
Pieces of "strings" and consecutive sequences of %dec$hex code point values can be concatenated with
"+" character to form a coherent block of text. The use of concatenator "+" also allows to span text
definition over as many lines as needed.
Syntax of Insertable Sequence Tag
|
( ( String | (Hex) | (Dec) )* + [ "+" ] )*
|
String
|
" & [ "" | 0x20 | 0x21 | 0x23..0x10FFFF ]* & "
|
Hex
|
"$" & ( ~"a".."f" | Digit )*
|
Dec
|
"%" & Digit*
|
TemlCode Example of Insertable Text Sequences
|
€ = ~($20AC) or ~(%8364)
Hello = U+0048 U+0065 U+006C U+006C U+006F <- Unicode notation Hello <- HTML & XML notation ~($48$65$6C$6C$6F) <- TemlCode notation
Sushi (寿司) = U+5BFF U+53F8 寿司 ~($5BFF$53F8)
"Hello, 寿司 costs 50 € in Europe." = ~($48$65$6C$6C$6F;", ";$5BFF$53F8;" costs" + "50 " + %8364 + " in Europe.")
|
Tilde
Tilde character "~" is used in TemlCode as an initiating character of escape sequence for Markup Tags.
That's the reason, why combinations ~\ ~< ~> ~[ ~] ~{ ~} ~( ~) cannot be used
in TemlCode stream directly to be represented as a plain text. Workaround to this escape logic problem
is to use the Insertable Tilde Tag.
Syntax of Insertable Sequence Tag
|
~( ~ & [~]* )
|
TemlCode Example of Insertable Tilde
|
~(~)( This is Plain Text ) <- in TemlCode ~( This is Plain Text ) <- Rendered
~("This is Insertable")
~(~~~)\ Three Tildes \ <- in TemlCode ~~~\ Three Tildes \ <- Rendered
|
Insertable CRLF Tag
Special meaning is assigned to the ~) Insertable Markup Tag.
It means Carriage Return & Line Feed. While this is quite a historical name it is still used
in text files on Windows to transfer flow of text to the new line (0xA 0xD). In TemlCode
it indicates that flow of text should continue from left on a new line. Semanticaly it's the same meaning
as <br> tag in HTML or '\n' escape in C/C++.
TemlCode Example of Insertable CRLF Tags
|
Currently, we have open the following positions: ~(p) <- paragraph indentation
API Developer~) <- CRLF indentation File Format Developer~) Domain Specialist Developer~) Platform Developer~) Documentation Engineer~) Senior Programmer
|
Tell Us What You Think