Skip to content

Post Processing

Carl Smith edited this page May 30, 2018 · 1 revision

Frozen docs (and elements) can be accessed by invoking the instance, passing the appropriate key:

docs("404 Error")

The freezer key is the only required argument. It is followed by any number of positional and keyword arguments, which are all passed along to str.format, which is called on the frozen doc before it is returned.

You can use text nodes to embed formatting markers into the document that str.format will recognize when the doc is processed (see the Complete Example in the wiki for an example of this).

Python’s string formatting mini-language is flexible and very fast (the HTME source is optimized for simplicity and readability). If performance is important, HTME can be used to freeze documents when an application launches, so performance critical code (like a request handler) only depends on str.format.

Clone this wiki locally