I am generally okay with that, it seems to be the most flexible solution.
At the Developers Meeting we also discussed another solution:
Having a header and a footer part inside the ZIM file, so the HTML page would be constructed by the reader by concatenating header, article and footer together.
But I think that the solution with the parser is much better.
In the zim lib we have a class "zim::Article". This has a method "getData()", which returns the article data of the page. I would add a new method "getPage()", which uses the layout page to return the complete page.
This layout page should only be used, when the mime type is zimMimeTextHtml.
Wouldn't it be sensible to be able to have also templates for other MIME types? I think of the J or U namespaces for image and category description pages?
Greets,
Manuel