'>>> import textile
>>> textile.textile(\'some textile\')
u\'\t<p>some textile</p>\''

def textile(self, text, rel=None, head_offset=0, html_type='xhtml'):

    self.html_type = html_type
    text = _normalize_newlines(text)
    if self.restricted:
        text = self.encode_html(text, quotes=False)
    if rel:
        self.rel = ('    rel="%s"' % rel)
    text = self.getRefs(text)
    text = self.block(text, int(head_offset))
    text = self.retrieve(text)
    text = smartyPants(text, 'q')
    return text
