def generate_fragment(self, req, filename, data, text=False, domain=None):
        """Produces content ready to be sent from the given template
        *filename* and input *data*, with minimal overhead.

        It calls `prepare_template` to augment the *data* with the