def to_html(body, markdown): if markdown == 'markdown': body_html = markdown2.markdown(body) elif markdown == 'textile': body_html = textile.textile(body, ) else: body_html = body return body_html
def to_html(body,markdown): if markdown == 'markdown': body_html = markdown2.markdown(body) elif markdown == 'textile': body_html = textile.textile(body,) else: body_html = body return body_html
def markup(text, format=None): """ Render the given text to HTML """ if format == 'html': # Return the text as is return text elif format == 'textile': from lib.textile import textile return textile(text) # The default markup is Markdown from lib import markdown2 return markdown(text, ['codehilite'])
def render_textile(content): return textile.textile(content.encode('utf-8'))