Esempio n. 1
0
def to_str(text, format, encoding='utf-8'):
    if format == 'xml':
        events = block_stream(text)
        return stream_to_str(events, encoding)
    elif format == 'xhtml':
        events = to_html_events(text)
        return stream_to_str_as_xhtml(events, encoding)
    elif format == 'html':
        events = to_html_events(text)
        return stream_to_str_as_html(events, encoding)
    elif format == 'latex':
        events = block_stream(text)
        return stream_to_str_as_latex(events, encoding)

    raise ValueError, "unexpected format '%s'" % format
Esempio n. 2
0
def to_str(text, format, encoding='utf-8'):
    if format == 'xml':
        events = block_stream(text)
        return stream_to_str(events, encoding)
    elif format == 'xhtml':
        events = to_html_events(text)
        return stream_to_str_as_xhtml(events, encoding)
    elif format == 'html':
        events = to_html_events(text)
        return stream_to_str_as_html(events, encoding)
    elif format == 'latex':
        events = block_stream(text)
        return stream_to_str_as_latex(events, encoding)

    raise ValueError, "unexpected format '%s'" % format
Esempio n. 3
0
def to_html_events(text):
    events = block_stream(text)
    return to_xhtml_stream(events)
Esempio n. 4
0
def to_html_events(text):
    events = block_stream(text)
    return to_xhtml_stream(events)