Skip to content

Commit da2f115

Browse files
committed
Add about page to web app
1 parent 2c38cd5 commit da2f115

File tree

6 files changed

+54
-4
lines changed

6 files changed

+54
-4
lines changed

docs/about.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Objective
2+
**NEAM** is a system for extracting Named Entities in transcribed diary entries from the [Emma B. Andrews Diary Project](http://www.emmabandrews.org/project/). Found entities are tagged following the TEI schema of the project.
3+
4+
## Requirements
5+
* Creating a system that successfully extracts entities: people, places, and organizations
6+
* Tagging the entities with appropriate TEI tags and ref attributes
7+
* Establishing a baseline of accuracy

neam/python/app/routes.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
import os
22

3-
from flask import render_template, request, send_from_directory, jsonify, url_for
3+
from flask import render_template, request, send_from_directory, jsonify, url_for, Markup
4+
from markdown import markdown
5+
46
from neam.python.app import app, celery, neam_annotate
57

68

9+
FILE_DIR = os.path.dirname(os.path.realpath(__file__))
10+
11+
712
@app.route('/')
813
@app.route('/index')
914
def index():
1015
""" Routes the user to the index page """
1116
return render_template('index.html', title='NEAM Annotate')
1217

1318

19+
@app.route('/about')
20+
def about():
21+
""" Routes the user to the about page """
22+
with open(os.path.join(FILE_DIR, '..', '..', '..', 'docs', 'about.md')) as one_pager:
23+
content = '\n'.join(one_pager.readlines())
24+
return render_template('about.html', title='About NEAM', content=Markup(markdown(content)))
25+
26+
1427
@app.route('/annotate', methods=['POST'])
1528
def annotate():
1629
"""

neam/python/app/static/css/style.css

+21-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
background-color: #452a78;
77
}
88

9+
.brand-logo {
10+
margin-left: 1rem;
11+
}
12+
913
body {
1014
background-color: #f5f5f5;
1115
font-family: "Open Sans", Helvetica, Arial, Verdana, sans-serif;
@@ -21,10 +25,22 @@ input:not(.browser-default):focus:not([readonly]), textarea.materialize-textarea
2125
box-shadow: 0 1px 0 0 #558097 !important;
2226
}
2327

24-
h1 {
28+
h1, h2, h3 {
2529
font-family: "encode_sans_normalbold", sans-serif;
2630
}
2731

32+
h1 {
33+
font-size: 2.8rem;
34+
}
35+
36+
h2 {
37+
font-size: 2.3rem;
38+
}
39+
40+
h3 {
41+
font-size: 1.8rem;
42+
}
43+
2844
strong {
2945
font-weight: bolder;
3046
}
@@ -34,3 +50,7 @@ strong {
3450
background-color: white;
3551
}
3652

53+
.box h2:first-child {
54+
margin-top: .5rem;
55+
}
56+

neam/python/app/templates/about.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends "layout.html" %}
2+
3+
{% block content %}
4+
<h1 class="center-align">About NEAM</h1>
5+
<div class="row box z-depth-2">
6+
{{ content }}
7+
</div>
8+
{% endblock %}

neam/python/app/templates/layout.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
<body>
1414
<nav>
1515
<div class="nav-wrapper">
16-
<ul id="nav-mobile" class="left hide-on-med-and-down">
17-
<li><a>Link</a></li>
16+
<a href="/" class="brand-logo">NEAM</a>
17+
<ul id="nav-mobile" class="right hide-on-med-and-down">
18+
<li><a href="/about">About</a></li>
1819
</ul>
1920
</div>
2021
</nav>

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ numpy==1.13.3
66
flask
77
celery
88
gunicorn
9+
markdown
910
redis
1011
lxml
1112
pywikibot

0 commit comments

Comments
 (0)