What is the simplest language which support template&context mechanism?
===

I need to find the easiest way to automatically build ebooks from downloaded articles.

I want to automatically generate TOC, which will be based on HTML template.

I know that python django has template&context mechanism, however django is a little to complicated for people to which I am preparing this whole mechanism. I don't need all web-related features.
