Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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'])
Exemplo n.º 4
0
def render_textile(content):
  return textile.textile(content.encode('utf-8'))