Skip to content

Instantly share code, notes, and snippets.

@mtayseer
Created March 9, 2014 14:14
Show Gist options
  • Save mtayseer/9448380 to your computer and use it in GitHub Desktop.
Save mtayseer/9448380 to your computer and use it in GitHub Desktop.
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