TemlCode Section
Section is the highest level structural element. It's purpose is to divide a whole TemlCode file
into the smaller units called Sections. A single section is then used to contain a coherent
piece of information like a page of document, embedded image or data, drawing, configuration, data
definitions, source code of some program and so on. This way a project, which would otherwise
in XML (or HTML) consist of several files, can be combined into the one single continuous file,
where project subfiles are stored in particular sections. TemlCode has possibilities on how to
avoid potential breakage on the markup code logic, when incorporating external files even the ones
with unknown syntax.
Section starts with Section Start Tag and ends on nearby occurence of another Section Start Tag
or on it's counterpart Section Exit Tag (which can be in short or named form). The space before
the first section in file is called "White space".
Section can start and exit anywhere in the TemlCode data stream regardless of line ends. Section
Markup Tag can even cross over multiple lines if needed (due to parameters definition).
Syntax of Section Start Tag
|
~\ Id & [Label] + [Properties] \
|
Label
|
"@" & ( Name | StringFF )
& [ "." & ( Name | StringFF ) ]*
& [ ":" & ( Name | StringFF ) ]
|
Properties
|
< Parameter [ ";" Parameter ";" ... ";" Parameter [";"] ]>
|
Id
Id of Section Start Tag denotes some class - a general group of use, to which the whole section relates.
This part of Tag syntax is mandatory.
Label
Label names particular Section Start Tag in namespace of given Id class. If there are more occurences of the same
Id@Label Section Start Tags, processing application should treat such cases as a continuation from one
section part to another.
This part of Tag syntax is optional.
Properties
Properties allows for additional attribution of aspects related to a particular block of data, which the
appropriate section embraces. It can be also used to pass a custom data into the section, the same way
it is possible to do in programming languages. All this behaviour depends on processing application.
Properties syntax is exactly the same, as described in previous chapter about TemlCode Properties.
There is only one little syntactical difference - no prepending "~" Tilde character is used to define properties
enclosed in "< ... >".
This part of Tag syntax is optional.
TemlCode Example of various Sections and their use
|
This is a White Space before any Sections.
~\text@"About Apple Fruit":version_015\
The apple is the pomaceous fruit of the apple tree, species Malus domestica in the rose family Rosaceae. It is one of the most widely cultivated tree fruits. The tree is small and deciduous, reaching 5 to 12 m tall, with a broad, often densely twiggy crown. The leaves are alternately arranged simple ovals 5 to 12 cm long and 3–6 cm broad on a 2–5 cm petiole with an acute tip, serrated margin and a slightly downy underside.
Image of the Apple: ~(image <ref=jpeg@apple.jpg>)
Author: ~(insert <ref=text@copyright_info; #name="John Smith">)
~\jpeg@apple.jpg <format=JPEG;width=50;height=45;encoding=base64>\
ajyGfvsksKhsqj6s?654bjJbvVJhjbMnbmajhcghj2ndmn3u8ewbwufIHhbqwi9bw32 rnNBvdhdkdsk897dcyJHGJhjjhedjhk789cbnjkkj986!!xcjhj9c7hjnmsnn977bbv vghg76gJKjhhjc??dewJKkjh90jkh908jkhmnHJKjbhkjhdfklch8j8t5fo08hnj987 Hy8877yh**
~\text@copyright_info <#name : CharString >\
Copyright 2008 by ~(#name), All rights reserved.
~\\
This is a White Space after all Sections.
|
Section Exit
Section Exit Markup Tags can be either in Short form or in Named form. If there are no Section Exit Tags,
current Section is valid until another Section Start Tag or till the end of file.
Short Form
Syntax of Short form of Section Exit Tag
|
~\\
|
This short form closes nearby Section found by tracing back for the first unclosed Section.
When found, all space after this Short form of Section Exit Tag becomes a White Space.
Named Form
Syntax of Named form of Section Exit Tag
|
~\~Id & [Label] \
|
This named form closes nearby Section found by tracing back for the first unclosed Section, which
matches the Id@Label definition. When found, all space after this Named form of Section Exit Tag
becomes a White Space. Label definition is optional and when not present, backtracked for closure
is first Section Start Tag of matching Id class.
Besides a possibility of exact Section Exit Tag definition, this
allows for creation of nested sections, where the scope of validity of child sections is
demarked by scope of validity of it's master sections.
TemlCode Example of Sections nesting
|
A Zone
~\text@subject.master\
B Zone
~\text@subject.child.1\
C Zone
~\text@subject.child.2\
D Zone
~\~text@subject.master\
E Zone
|
In this example, the A & E Zone are White Spaces, "text@subject.master" section is valid through
B, C & D Zone, "text@subject.child.1" section is valid in C Zone and "text@subject.child.2" section
is valid in D Zone.
Tell Us What You Think