コード例 #1
0
ファイル: tasks.py プロジェクト: mmcnickle/peps
def text2html(input_lines):

    from pep2html import fixfile
    from StringIO import StringIO

    s = StringIO()

    fixfile("", input_lines, s)

    return s.getvalue().decode("utf-8")
コード例 #2
0
ファイル: tasks.py プロジェクト: d0ugal-archive/peps
def text2html(input_lines):
    """
    Render a text (non-rst) pep as HTML. This uses all of the original code in
    pep2html.py convertor in the pep repo.
    """

    from pep2html import fixfile
    from StringIO import StringIO

    s = StringIO()

    fixfile("", input_lines, s)

    return s.getvalue().decode("utf-8")