UL4 -- A templating language ############################ :mod:`ll.ul4c` provides templating for XML/HTML as well as any other text-based format. A template defines placeholders for data output and basic logic (like loops and conditional blocks), that define how the final rendered output will look. :mod:`ll.ul4c` compiles a template to an internal format, which makes it possible to implement renderers for these templates in multiple programming languages. .. note:: Apart from this Python implementation there are implementations for Java_ (both a compiler and renderer) and Javascript_ (renderer only). .. _Java: https://github.com/LivingLogic/LivingLogic.Java.ul4 .. _Javascript: https://github.com/LivingLogic/LivingLogic.Javascript.ul4 In the template source any text surrounded by ```` and ``?>`` is a "template tag". The first word inside the tag is the tag type. It defines what the tag does. For example ```` is a print tag (it prints the value of the variable ``foo``). A complete example template looks like this: .. sourcecode:: xml+ul4