.\" /usr/share/misc/man.template: .\" The following six lines are required. .Dd April 10, 2002 .Os Linux [4/3] .Dt METATEMPLATE 1 .Sh NAME metatemplate \- metatemplate compiler .Sh SYNOPSIS .Nm metatemplate Ar filename .Sh DESCRIPTION .Nm metatemplate create template and dynamic pieces of php code from a uniq html metatemplate. .br To use metatemplate you need a tree like this: .br .ft C somedir/ .br somedir/Obj/ .br somedir/Pho/ .br somedir/Preview/ .br somedir/Template/ .br somedir/metatempl1.html .br somedir/metatempl2.html .br somedir/...... .br .ft R .Nm cd Ar somedir .br and run .br .Nm metatemplate Ar metatempl1.html .br .Nm metatemplate Ar metatempl2.html .br .Nm metatemplate .No ............... .Sy METATAGS DESCRIPTION .br .fc # ^ .ta 2.5i 5i .Sy "##" #-\ Open include maker# .br .Sy "##" #-\ Close include maker# .br .Sy "##" #-\ Insert include# .br .Sy "##" #-\ Open object# .br .Sy "##" #-\ Close object# .br .Sy "##" #-\ Open element# .br .Sy "##" #-\ Close element# .br .Sy "##" #-\ Open virtual element# .br .Sy "##" #-\ Close virtual element# .br .ta .8i 1.6i 2.4i 3.2i 4i 4.8i 5.6i 6.4i 7.2i 8i .fc .Sy CREATE INCLUDES .br You can make an include file named .Pa myinc putting a: .br .Sy "\ " .br before the first line that you want into the include .br and a: .br .Sy "\ " .br after the last. .br .Sy INCLUDE FILES .br You can include file named .Pa myinc putting a: .br .Sy "\ " .br .Sy INCLUDES NOTE .br You can define an include definition into another include definition nesting .Sy 'MINCL' '/MINCL' tags. .bp .Sy NESTIFIED INCLUDES DEFINITION EXAMPLE .br When compiling this example with .Sy metatemplate .ft C .br bla bla .br bla bla .br .br ble ble .br .br blo blo .br blo blo .br .br .ft R you create 2 files named .Pa big No : .br .ft C bla bla .br bla bla .br ble ble .br blo blo .br blo blo .br .ft R and .Pa little Ns No : .br .ft C ble ble .br .ft R .Sy INCLUDE FILES EXAMPLE .br If you want to include the file .Ar big into your metatemplate file you must use: .br .ft C .ft R .Sy CREATE OBJECTS AND ELEMENTS .br An object is a collection of elements. .br Objects aren't nestable. .br Every object produces a php include file (Pho directory). .br An element is a piece of the metatemplate file the is enclosed between the open and close elements tags, it is put into an element of a php associative array named like the parent object, indexed with the name of the element perfixed eventually with the names of the parent elements and placed into the object-related php include file. .br If the element is not virtual the element is replaced into the parent (template or element) with a tag that is the name of the element prefixed with the name of parent object + (eventually) the names of all parents elements "_" separated. .br If the element is virtual it isn't replaced with a tag. .br Elements are nestable. .br .Sy OBJECTS AND ELEMENTS EXAMPLE .br When compiling this example name .Pa example.html with .Sy metatemplate .br .ft C begin of metatemplate .br .br .br .br .br .br
#COL1##COL2#
.br bla bla .br .br bli bli .br this piece of code is visualized when some test is true .br #SOMETAG# .br blo blo .br .br .br olb olb .br elsewhere this piece of code is visualized .br #SOMETAG# .br .br bli bli #SUBTAG# .br .br ilb ilb .br .br .br end of metatemplate .br .ft R .Sy metatemplate produces this output on the console: .br .ft C \-------- includes creation -------- \-------- objects creation -------- obj: myobj #MYOBJ_TBROW# ele:[tbrow] #COL1# #COL2# ele close #MYOBJ_IFBRANCH# ele:[ifbranch] #SOMETAG# ele close ele:[elsebranch] virtual #SOMETAG# #ELSEBRANCH_ELSUBELE# ele:[elsebranch_elsubele] #SUBTAG# ele close ele close obj close .ft R this php include named .Pa myobj.pho : .ft C #COL1##COL2# '; $myobj['ifbranch'] = ' bli bli this piece of code is visualized when some test is true #SOMETAG# blo blo '; $myobj['elsebranch_elsubele'] = ' bli bli #SUBTAG# '; $myobj['elsebranch'] = ' olb olb elsewhere this piece of code is visualized #SOMETAG##ELSEBRANCH_ELSUBELE#ilb ilb '; ?> .ft R and this template named .Pa Template/example.tmpl : .ft C begin of metatemplate #MYOBJ_TBROW#
bla bla #MYOBJ_IFBRANCH# end of metatemplate .ft R .\" The following requests should be uncommented and .\" used where appropriate. This next request is .\" for sections 2 and 3 function return values only. .\" .Sh RETURN VALUES .\" This next request is for sections 1, 6, 7 & 8 only .\" .Sh ENVIRONMENT .\" .Sh FILES .\" .Sh EXAMPLES .\" This next request is for sections 1, 6, 7 & 8 only .\" (command return values (to shell) and .\" fprintf/stderr type diagnostics) .\" .Sh DIAGNOSTICS .\" The next request is for sections 2 and 3 error .\" and signal handling only. .\" .Sh ERRORS .\" .Sh SEE ALSO .\" .Sh STANDARDS .\" .Sh HISTORY .Sh AUTHORS Matteo Nastasi, Digital Identity (www.digitalidentity.it) .br m.nastasi@digitalidentity.it .br nastasi@alternativeoutput.it .\" .Sh BUGS