Commit 21bfeece authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Add support for Markdown in the dataset descriptions

parent d129a7bb
......@@ -16,7 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import os.path
import io
......@@ -25,6 +24,7 @@ import re
from collections import defaultdict
import functools
import pickle
from flask import Flask, render_template, make_response, redirect, Markup, \
send_file, abort, request, jsonify, url_for
......@@ -54,6 +54,8 @@ analyze.analyze_entries(entries.values(), skip=["pos"],
whales = ["openstreetmap"]
import markdown
@app.context_processor
def file_processor():
def file_size(filename):
......@@ -127,7 +129,9 @@ def network_page(net):
page = int(request.args.get('page', 1))
page_size = 1000 if not full else len(entry.files)
return render_template('network.html', entry=entry,
desc = markdown.markdown(entry.description, extensions=['footnotes'])
return render_template('network.html', entry=entry, description=desc,
page=page, page_size=page_size)
......
......@@ -17,6 +17,8 @@ p, dd, li {
line-height:1.4em;
}
dd p:last-child { margin-bottom: 0 }
/* ul, ol
{
list-style-position:inside;
......@@ -132,3 +134,18 @@ table.ink-table tr th.tight
.ink-form input[type="color"] {
font-family: 'Ovo', serif;
}
.footnote {
font-size: x-small;
margin-top: -1.305em;
}
.footnote hr {
margin-top: .9em;
margin-bottom: 0em;
}
.footnote ol {
margin-top: 0;
margin-bottom: 0;
}
......@@ -20,7 +20,7 @@ active
</h1>
<dl>
<dt>Description</dt>
<dd style="white-space: pre-wrap;">{{entry.description}}</dd>
<dd>{{description | safe}}</dd>
<dt>Tags</dt>
<dd>
{% for tag in entry.tags %}
......@@ -222,7 +222,7 @@ active
</a>
{% endif %}
{% endfor %}
</dt>
</dd>
{% endif %}
</dl>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment