1 .\" /usr/share/misc/man.template:
2 .\" The following six lines are required.
7 metatemplate \- metatemplate compiler
9 .Nm metatemplate Ar filename
12 create template and dynamic pieces of php code from a uniq
15 To use metatemplate you need a tree like this:
28 somedir/metatempl1.html
30 somedir/metatempl2.html
40 .Nm metatemplate Ar metatempl1.html
42 .Nm metatemplate Ar metatempl2.html
47 .Sy METATAGS DESCRIPTION
52 .Sy "#<!--MINCL:" Ns Ar "includename" Ns Sy "-->#"
53 #-\ Open include maker#
56 #-\ Close include maker#
58 .Sy "#<!--MIGTO:" Ns Ar "includename" Ns Sy "-->#"
61 .Sy "#<!--MIOBJ:" Ns Ar "objectname" Ns Sy "-->#"
67 .Sy "#<!--MI:" Ns Ar "elementname" Ns Sy "-->#"
73 .Sy "#<!--MO:" Ns Ar "virtelename" Ns Sy "-->#"
74 #-\ Open virtual element#
77 #-\ Close virtual element#
80 .ta .8i 1.6i 2.4i 3.2i 4i 4.8i 5.6i 6.4i 7.2i 8i
84 You can make an include file named
88 .Sy "\ <!--MINCL:" Ns Ar "myinc" Ns Sy "-->"
90 before the first line that you want into the include
101 You can include file named
105 .Sy "\ <!--MIGTO:" Ns Ar "myinc" Ns Sy "-->"
110 You can define an include definition into another include definition nesting
114 .Sy NESTIFIED INCLUDES DEFINITION EXAMPLE
116 When compiling this example with
138 you create 2 files named
161 .Sy INCLUDE FILES EXAMPLE
163 If you want to include the file
165 into your metatemplate file you must use:
171 .Sy CREATE OBJECTS AND ELEMENTS
173 An object is a collection of elements.
175 Objects aren't nestable.
177 Every object produces a php include file (Pho directory).
179 An element is a piece of the metatemplate file the is enclosed between
180 the open and close elements tags, it is put into an element of a
181 php associative array named like the parent object, indexed with the
182 name of the element perfixed eventually with the names of the parent
183 elements and placed into the object-related php include file.
185 If the element is not virtual the element is replaced into the parent
186 (template or element) with a tag that is the name of the element prefixed
187 with the name of parent object + (eventually) the names of all parents
188 elements "_" separated.
190 If the element is virtual it isn't replaced with a tag.
192 Elements are nestable.
195 .Sy OBJECTS AND ELEMENTS EXAMPLE
197 When compiling this example name
203 begin of metatemplate
212 <tr><td>#COL1#</td><td>#COL2#</td>
225 this piece of code is visualized when some test is true
238 elsewhere this piece of code is visualized
260 produces this output on the console:
263 \-------- includes creation --------
264 \-------- objects creation --------
266 #MYOBJ_TBROW# ele:[tbrow]
270 #MYOBJ_IFBRANCH# ele:[ifbranch]
273 ele:[elsebranch] virtual
275 #ELSEBRANCH_ELSUBELE# ele:[elsebranch_elsubele]
282 this php include named
286 <?php /* generated from file "example.html" */
289 <tr><td>#COL1#</td><td>#COL2#</td>
291 $myobj['ifbranch'] = '
293 this piece of code is visualized when some test is true
297 $myobj['elsebranch_elsubele'] = '
300 $myobj['elsebranch'] = '
302 elsewhere this piece of code is visualized
303 #SOMETAG##ELSEBRANCH_ELSUBELE#ilb ilb
308 and this template named
309 .Pa Template/example.tmpl
312 begin of metatemplate
314 <table>#MYOBJ_TBROW#</table>
316 bla bla #MYOBJ_IFBRANCH#
321 .\" The following requests should be uncommented and
322 .\" used where appropriate. This next request is
323 .\" for sections 2 and 3 function return values only.
324 .\" .Sh RETURN VALUES
325 .\" This next request is for sections 1, 6, 7 & 8 only
329 .\" This next request is for sections 1, 6, 7 & 8 only
330 .\" (command return values (to shell) and
331 .\" fprintf/stderr type diagnostics)
333 .\" The next request is for sections 2 and 3 error
334 .\" and signal handling only.
340 Matteo Nastasi, Digital Identity (www.digitalidentity.it)
342 m.nastasi@digitalidentity.it
344 nastasi@alternativeoutput.it