1 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" >
2 <?python
3 from genshi import HTML
4 from pygments.lexers import get_lexer_by_name
5 from pygments import highlight
6 from pygments.formatters import HtmlFormatter
7 lexer = get_lexer_by_name(row['language'])
8 ?>
9 <head>
10 <title>Pastebin</title>
11 <style>
12 ${HtmlFormatter().get_style_defs('.highlight')}
13 </style>
14 </head>
15 <body>
16 <p><a href="./">Up</a></p>
17 <h3>${row['filename']}</h3>
18 <div>${HTML(highlight(row['code'], lexer, HtmlFormatter(linenos='inline')))}
19 </div>
20 <p>
21 <form method="POST" action="${row[primary]}">
22 <input type="hidden" name="_method" value="DELETE"/>
23 <input type="submit" value="Delete"/>
24 </form>
25 </p>
26 </body>
27 </html>