master
supisara 2 years ago
commit ed07de9d09

1
.gitignore vendored

@ -0,0 +1 @@
venv/

@ -0,0 +1,37 @@
from flask import Flask, render_template, send_from_directory
import os
from glob import glob
from markdown import markdown
def list_dir(folder):
return os.listdir(folder)
def list_entries(folder):
return glob(f"{folder}/*.md")
def get_content(file):
with open(file) as f:
content = f.read()
return markdown(content)
app = Flask(__name__)
@app.route("/")
def home():
issues=list_dir("issues")
return render_template("home.html", issues=issues)
@app.route("/issues/<slug>/")
def issue(slug):
entries = ""
for entry in list_entries(f"issues/{slug}"):
entries += get_content(entry)
return render_template("issue.html", issue=slug, entries=entries)
@app.route("/issues/<slug>/<file>")
def file(slug, file):
return send_from_directory(f"issues/{slug}", file)
app.run(port=3000, debug=True)

@ -0,0 +1,2 @@
entry 1 test
![image of a switch](test.jpg)

@ -0,0 +1,8 @@
# Title
## Sub
###
####
#####
_italics_
__bold__
[text link](https://aaaaaaaaa)

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

@ -0,0 +1,12 @@
on the fly documentation of triggers and responses in everyday curiosities
- focus on (beginner) learner's mindset through the act of making
- part of ongoing research and experiments around DIY practices and disobedience
- how does approaching a new or challenging topic or activity as a beginner or nonspecialist affect the way you learn and discover something?
- an exercise on sensitivity awareness of user interfaces and interactions in different environments
incidents:
01 food
02 pen
03 notebook
04 sound

@ -0,0 +1,9 @@
click==8.1.3
Flask==2.2.2
importlib-metadata==5.1.0
itsdangerous==2.1.2
Jinja2==3.1.2
Markdown==3.4.1
MarkupSafe==2.1.1
Werkzeug==2.2.2
zipp==3.11.0

@ -0,0 +1,3 @@
html{
color: red
}

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DIYry</title>
<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">
</head>
<body>
it works!!!!
<ul>
{% for issue in issues %}
<li><a href="{{url_for('issue', slug=issue)}}">{{issue}}</a></li>
{% endfor %}
</ul>
</body>
</html>

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{issue}}</title>
</head>
<body>
{{entries|safe}}
</body>
</html>
Loading…
Cancel
Save