Fragment ======== Base class: :doc:`Part` `Fragment` is a class used to build small HTML fragments that plug into iommis structure. .. test from iommi.fragment import Fragment .. code:: python h1 = Fragment(children__text='Tony', tag='h1') It's easiest to use via the html builder: .. code:: python h1 = html.h1('Tony') Fragments are useful because attrs, template and tag are evaluated, so if you have a `Page` with a fragment in it you can configure it later: .. code:: python class MyPage(Page): header = html.h1( 'Hi!', attrs__class__staff= lambda request, **_: request.user.is_staff, ) Rendering a `MyPage` will result in a `