nestable template engine:
-------------------------
base:
<title>Top <insert></title>
<body>
header
<insert>
footer
</body>
-------------------------
two columns (uses base):
<title>Middle <insert></title>
<body>
<content>
contentHeader
<insert>
contentFooter
</content>
<menu>
menuHeader
<insert>
menuFooter
</menu>
</body>
--------------------------------
actual page (uses two columns):
<title>Inner</title>
<body>
<content>
Hello this is content.
</content>
<menu>
Link1 | Link2 | Link3
</menu>
</body>
---------------------------------------------------------
1. start processing from top most template
2. start processing section from top most section, order top-> bottom in code
3. insert: insert everything between the section tags in the next template, ignore sections defined in the top most template (including the section tags themselves),
4. when all sections defined in top most where processed, restart with the new assembled source and next template if any, else, output.
-------------------------
resulting page:
<title>Top Middle Inner</title>
<body>
<content>
contentHeader
Hello this is content.
contentFooter
</content>
<menu>
menuHeader
Link1 | Link2 | Link3
menuFooter
</menu>
before footer
</body>