summary refs log tree commit diff
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-09-09 01:30:53 +0300
committertzlil <tzlils@protonmail.com>2023-09-09 01:30:53 +0300
commit848dd36a72e11a859b9dafbdfb26cece3568d011 (patch)
tree4c4139b6b68b3c9e43078beb7624ea5090a0eded
parent0deb290b05b6be68d40eb750d4eb5a244d6c56d8 (diff)
make html a little nicer
-rw-r--r--app.py4
-rw-r--r--templates/index.html2
-rw-r--r--templates/topic.html4
3 files changed, 6 insertions, 4 deletions
diff --git a/app.py b/app.py
index c60a4bd..fc224ba 100644
--- a/app.py
+++ b/app.py
@@ -10,6 +10,7 @@ from flask import Flask, abort, render_template
 from functools import cache
 import feedparser
 import multiprocessing
+import time
 
 mp = multiprocessing.get_context('spawn')
 parse = lambda l: bs(urllib.request.urlopen(l), 'html.parser')
@@ -63,8 +64,7 @@ def random(topic):
     link = 'https://arxiv.org/abs/'+paper    
     feed = feedparser.parse(f'http://export.arxiv.org/api/query?id_list={paper}')
     entry = feed['entries'][0]
-
-    return render_template('topic.html', description=entry['description'], title=entry['title'], link=link)
+    return render_template('topic.html', description=entry['description'], title=entry['title'], link=link, authors=entry['authors'], published=time.strftime('%d %b %Y', entry['published_parsed']))
 
 @app.route('/')
 def index():
diff --git a/templates/index.html b/templates/index.html
index 7f7c2cf..87e164c 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -11,6 +11,6 @@
 all possible categories <a href="https://arxiv.org/category_taxonomy">here</a>
 examples:
 {% for i in taxonomy %}
-  <a href='/{{ i }}'>{{ i }}</a>
+  <a href='{{ i }}'>{{ i }}</a>
 {% endfor %}
 </html>
diff --git a/templates/topic.html b/templates/topic.html
index b8c9d2c..f8cad13 100644
--- a/templates/topic.html
+++ b/templates/topic.html
@@ -22,8 +22,10 @@ MathJax = {
 </head>
 
 <body>
+  <i>Submitted on {{published}}</i>
 	<h1>{{title}}</h1>
-	<h2>{{description}}</h2>
+  <h2>{{ authors|map(attribute='name')|join(', ') }}</h2>
+	<h3>{{description}}</h3>
 	<a href="{{link}}">{{link}}</a>
 </body>
 </html>