defunkt/pystache — Issue #58: Create a Renderer class (make Template class smaller)
Author: cjerdonek
Created: 2011-12-21 05:23:58+00:00
State: open

We could simplify the code a bit by creating a Renderer class to house the rendering logic separate from the Template class.

This class would be used internally by the Template class and would operate only on unicode strings and Context instances. The end-user wouldn't interact with the Renderer class directly. The Template class would serve for now as the end-user API for the Renderer class and would do the necessary pre-processing (e.g. creating a Context instance) and post-processing (e.g. calling result.encode()).

This will also make it easier for us to focus on the rendering logic itself, because it will be more separate from less related considerations (separation of concerns).