Allura/allura/lib/helpers.py
def render_any_markup(name, txt, code_mode=False, linenumbers_style=TABLE):
    """
    renders markdown using allura enhacements if file is in markdown format
    renders any other markup format using the pypeline
    Returns jinja-safe text
    """
    if txt == '':
        txt = '<p><em>Empty File</em></p>'
    else:
        fmt = g.pypeline_markup.can_render(name)
        if fmt == 'markdown':
            txt = g.markdown.convert(txt)
        else:
            txt = g.pypeline_markup.render(name, txt)
        if not fmt:
            if code_mode and linenumbers_style == INLINE:
                txt = _add_inline_line_numbers_to_text(txt)
            elif code_mode and linenumbers_style == TABLE:
                txt = _add_table_line_numbers_to_text(txt)
            else:
                txt = '<pre>%s</pre>' % txt
    return Markup(txt)

    renders markdown using allura enhacements if file is in markdown format
    renders any other markup format using the pypeline
    Returns jinja-safe text
    
renders markdown using allura enhacements if file is in markdown format
renders any other markup format using the pypeline
Returns jinja-safe text
renders markdown using allura enhacements if file is in markdown format renders any other markup format using the pypeline Returns jinja - safe text
def render_any_markup(name, txt, code_mode=False, linenumbers_style=TABLE):
    if txt == '':
        txt = '<p><em>Empty File</em></p>'
    else:
        fmt = g.pypeline_markup.can_render(name)
        if fmt == 'markdown':
            txt = g.markdown.convert(txt)
        else:
            txt = g.pypeline_markup.render(name, txt)
        if not fmt:
            if code_mode and linenumbers_style == INLINE:
                txt = _add_inline_line_numbers_to_text(txt)
            elif code_mode and linenumbers_style == TABLE:
                txt = _add_table_line_numbers_to_text(txt)
            else:
                txt = '<pre>%s</pre>' % txt
    return Markup(txt)
def render_any_markup ( name , txt , code_mode = False , linenumbers_style = TABLE ) : if txt == '' : txt = '<p><em>Empty File</em></p>' else : fmt = g . pypeline_markup . can_render ( name ) if fmt == 'markdown' : txt = g . markdown . convert ( txt ) else : txt = g . pypeline_markup . render ( name , txt ) if not fmt : if code_mode and linenumbers_style == INLINE : txt = _add_inline_line_numbers_to_text ( txt ) elif code_mode and linenumbers_style == TABLE : txt = _add_table_line_numbers_to_text ( txt ) else : txt = '<pre>%s</pre>' % txt return Markup ( txt )
renders markdown using allura enhacements if file is in markdown format
renders any other markup format using the pypeline
Returns jinja-safe text
renders markdown using allura enhacements if file is in markdown format renders any other markup format using the pypeline Returns jinja - safe text
"""
    renders markdown using allura enhacements if file is in markdown format
    renders any other markup format using the pypeline
    Returns jinja-safe text
    """
name
txt
code_mode
linenumbers_style