Exemplo n.º 1
0
def process():
    source = request.params.source
    parser = request.params.parser or 'pukiwiki'
    converter = request.params.converter or 'confluence'
    prefer_h1 = bool(request.params.prefer_h1 or '')

    app.log.debug("parser = %s, prefer_h1 = %s" % (parser, prefer_h1))
    app.log.debug("===== source =====\n" + source)
    if not source:
        return redirect("/%s/%s" % (converter, parser))

    parser = create_parser(parser, {}, app.log)
    converter = create_converter(converter, { 'prefer_h1': prefer_h1 }, app.log)
    parser.parse(source, converter)

    return template(
        'complete.html',
        converter='confluence',
        converted_text=parser.buffer.value
    )
Exemplo n.º 2
0
def pukiwiki():
    return template(
        'index.html',
        parser='pukiwiki',
        converter='confluence',
    )
Exemplo n.º 3
0
def confluence():
    return template(
        'index.html',
        parser='confluence',
        converter='confluence',
    )