Created
March 9, 2014 14:14
-
-
Save mtayseer/9448380 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import route, run, template, request | |
index_template = '''<table width=100% height=100% border=1> | |
<tr> | |
<td width=50%> | |
<textarea style="width: 100%; height: 100%"></textarea> | |
</td> | |
<td> | |
<div id="result"> | |
</div> | |
</td> | |
</tr> | |
</table> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$('textarea').keyup(function() { | |
$.ajax({ | |
url: '/parse', | |
data: {'text': $('textarea').val()} | |
}).done(function(html) { | |
$('#result').html(html); | |
}) | |
}); | |
</script>''' | |
@route('/') | |
def index(): | |
return template(index_template) | |
@route('/parse') | |
def parse(): | |
import confluence_parser | |
reload(confluence_parser) | |
return confluence_parser.Confluence2HTML().parse(request.query.text) | |
run(host='localhost', port=8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment