commit ed07de9d091bc2eff85bb00a22024feb14cf75a6 Author: supisara Date: Fri Dec 9 23:03:54 2022 +0100 setup diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7275bb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ diff --git a/diyry.py b/diyry.py new file mode 100644 index 0000000..68a01cf --- /dev/null +++ b/diyry.py @@ -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//") +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//") +def file(slug, file): + return send_from_directory(f"issues/{slug}", file) + +app.run(port=3000, debug=True) \ No newline at end of file diff --git a/issues/1.pen/1.muji.md b/issues/1.pen/1.muji.md new file mode 100644 index 0000000..9e5afda --- /dev/null +++ b/issues/1.pen/1.muji.md @@ -0,0 +1,2 @@ +entry 1 test +![image of a switch](test.jpg) \ No newline at end of file diff --git a/issues/1.pen/2.copic.md b/issues/1.pen/2.copic.md new file mode 100644 index 0000000..008cc12 --- /dev/null +++ b/issues/1.pen/2.copic.md @@ -0,0 +1,8 @@ +# Title +## Sub +### +#### +##### +_italics_ +__bold__ +[text link](https://aaaaaaaaa) \ No newline at end of file diff --git a/issues/1.pen/test.jpg b/issues/1.pen/test.jpg new file mode 100644 index 0000000..825dcfb Binary files /dev/null and b/issues/1.pen/test.jpg differ diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..5420421 --- /dev/null +++ b/readme.md @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..23d0df1 --- /dev/null +++ b/requirements.txt @@ -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 diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..bdff0a8 --- /dev/null +++ b/static/style.css @@ -0,0 +1,3 @@ +html{ + color: red +} diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..fbe8b93 --- /dev/null +++ b/templates/home.html @@ -0,0 +1,19 @@ + + + + + + + DIYry + + + + it works!!!! + +
    + {% for issue in issues %} +
  • {{issue}}
  • + {% endfor %} +
+ + \ No newline at end of file diff --git a/templates/issue.html b/templates/issue.html new file mode 100644 index 0000000..f7df1d7 --- /dev/null +++ b/templates/issue.html @@ -0,0 +1,12 @@ + + + + + + + {{issue}} + + + {{entries|safe}} + + \ No newline at end of file