aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsudan <sudan@douban.com>2016-01-25 15:44:17 +0800
committersudan <sudan@douban.com>2016-01-25 15:44:17 +0800
commit0d89e0fce14edee3a3fa7571b5e7792e2bdb2197 (patch)
treedabedaed6fb92d67220efd33ad8b3585d72e8c32
parentstyle (diff)
downloadstackbin-0d89e0fce14edee3a3fa7571b5e7792e2bdb2197.tar.gz
stackbin-0d89e0fce14edee3a3fa7571b5e7792e2bdb2197.tar.bz2
stackbin-0d89e0fce14edee3a3fa7571b5e7792e2bdb2197.zip
code highlight
-rw-r--r--manage.py1
-rw-r--r--templates/layout.html6
-rw-r--r--templates/show_paste.html9
3 files changed, 12 insertions, 4 deletions
diff --git a/manage.py b/manage.py
index ccccf91..30f5ea5 100644
--- a/manage.py
+++ b/manage.py
@@ -1,7 +1,6 @@
from flask.ext.script import Manager, Server
from pastebin import app, db
-
manager = Manager(app)
diff --git a/templates/layout.html b/templates/layout.html
index 106ca8c..348df3e 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -5,10 +5,10 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}">
-<link rel="stylesheet" media="screen and (max-width: 800px)"
-href="{{ url_for('static', filename='small.css') }}" />
+<link rel="stylesheet" media="screen and (max-width: 800px)" href="{{ url_for('static', filename='small.css') }}" />
+<script type=text/javascript src="{{ url_for('static', filename='jquery.js') }}"></script>
-{#<script type=text/javascript src="{{ url_for('static', filename='jquery.js') }}"></script>
+{#
<script type=text/javascript src="{{ url_for('static', filename='pastebin.js') }}"></script>
<script type=text/javascript>
pastebin.urlRoot = {{ request.url_root|tojson|safe }};
diff --git a/templates/show_paste.html b/templates/show_paste.html
index 1c42e99..89ad18e 100644
--- a/templates/show_paste.html
+++ b/templates/show_paste.html
@@ -29,4 +29,13 @@
{% endif %}
</dl>
<div class=code><pre>{{ paste.code }}</pre></div>
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/highlight.js/9.1.0/styles/default.min.css">
+ <script src="//cdn.jsdelivr.net/highlight.js/9.1.0/highlight.min.js"></script>
+ <script>
+ $(document).ready(function() {
+ $('pre').each(function(i, block) {
+ hljs.highlightBlock(block);
+ });
+ });
+ </script>
{% endblock %}
bgstack15