def format_creole(code): """Format creole syntax.""" from creoleparser import creole2html rv = creole2html(code) if isinstance(rv, str): rv = rv.decode('utf-8') return u'<div class="wikitext">%s</div>' % rv
def render(self, req, mimetype, content, filename=None, rev=None): """Returns wikicreole text as html""" text = content_to_unicode(self.env, content, mimetype) if text.startswith(u"\ufeff"): text = text[1:] html = creoleparser.creole2html(text) return html
def render_creole(text): """Returns wikicreole text as html""" if text.startswith(u"\ufeff"): text = text[1:] html = creoleparser.creole2html(text) # convert wikicreole normally, and add a wiki class to each tablea stream = creoleparser.creole2html.generate(text) embodied_stream = stream.filter(wrap_stream(u"body")) transformed_stream = embodied_stream | Transformer(".//table").attr("class", "wiki") disembodied_stream = transformed_stream.select("*") html = disembodied_stream.render() return html
def render_creole(text): """Returns wikicreole text as html""" if text.startswith(u"\ufeff"): text = text[1:] html = creoleparser.creole2html(text) # convert wikicreole normally, and add a wiki class to each tablea stream = creoleparser.creole2html.generate(text) embodied_stream = stream.filter(wrap_stream(u"body")) transformed_stream = embodied_stream | Transformer(".//table").attr( "class", "wiki") disembodied_stream = transformed_stream.select("*") html = disembodied_stream.render() return html
def render(self, text, **kwargs): from creoleparser import creole2html return creole2html(text)
def rendered_description(self): """The description after it's been rendered to html.""" return creoleparser.creole2html(self.description)
def render(text): return creoleparser.creole2html(text)