summaryrefslogtreecommitdiff
path: root/pastepy/pastepy.py
diff options
context:
space:
mode:
Diffstat (limited to 'pastepy/pastepy.py')
-rw-r--r--pastepy/pastepy.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pastepy/pastepy.py b/pastepy/pastepy.py
index 472f6e2..f6b68ef 100644
--- a/pastepy/pastepy.py
+++ b/pastepy/pastepy.py
@@ -59,8 +59,7 @@ init_lexers()
@app.route('/paste')
def paste():
context = {
- 'title': current_app.config['PASTEBIN_NAME'],
- 'header': current_app.config['PASTEBIN_NAME'],
+ 'title': 'New paste',
}
return render_template('paste.html', **context)
@@ -156,8 +155,10 @@ def view_paste(paste_hash):
)
@app.route('/highlight_stylesheet')
-def highlight_stylesheet():
- return current_app.config['FORMATTER'].get_style_defs(), 200, {'Content-Type': 'text/css'}
+@app.route('/highlight_stylesheet/<style>')
+def highlight_stylesheet(style='default'):
+ formatter = CustomHtmlFormatter(linenos='table', lineanchors='line', anchorlinenos=True, style=style)
+ return formatter.get_style_defs(), 200, {'Content-Type': 'text/css', 'Cache-Control': 'public, max-age=31536000'}
@app.route('/raw/<paste_hash>')
def raw(paste_hash):