diff --git a/.gitignore b/.gitignore index a01b04e..8ac5a22 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ /static/html /static/video +venv/ +old_boat.py \ No newline at end of file diff --git a/flask_boat.py b/flask_boat.py index 713fbd0..76b4194 100644 --- a/flask_boat.py +++ b/flask_boat.py @@ -11,7 +11,6 @@ import json # FUNCTIONS - def list_files(folder, remove_ext=False): ''' Read all the functions in a folder ''' names = [] @@ -47,7 +46,7 @@ def get_md_contents(filename, directory='./contents'): def render_home(): - with open('render.html', 'r+w') as f: + with open('render.html', 'w') as f: # get the basic info of the website from the /contents/home.md file meta, content = get_md_contents("home.md") projects_list = [] @@ -72,32 +71,40 @@ def render_home(): } f.write(render_template("home.html", **home)) + # FLASK APP -base_url = "~kamo" -projects = 'projects' -# create flask application -app = Flask(__name__, - static_url_path=f'/soupboat/{base_url}/static', - static_folder=f'/soupboat/{base_url}/static') -# Markdown(app, extensions=['extra']) -# app.jinja_env.extend(jinja2_highlight_cssclass = 'codehilite') +class PrefixMiddleware(object): + def __init__(self, app, prefix=""): + self.app = app + self.prefix = prefix + def __call__(self, environ, start_response): + + if environ["PATH_INFO"].startswith(self.prefix): + environ["PATH_INFO"] = environ["PATH_INFO"][len(self.prefix) :] + environ["SCRIPT_NAME"] = self.prefix + return self.app(environ, start_response) + else: + start_response("404", [("Content-Type", "text/plain")]) + return ["This url does not belong to the app.".encode()] -# add the base_url variable to all the flask templates -@app.context_processor -def set_base_url(): - return dict(base_url=base_url) +projects = 'projects' + +# create flask application +app = Flask(__name__) +app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix='/soupboat/~kamo') + # Homepage -@app.route(f"/{base_url}/") +@app.route("/") def home_page(): return send_from_directory(app.root_path, 'render.html') # For generic pages we can include a common template and change only the contents -@app.route(f"/{base_url}//") +@app.route("//") def dynamic_page(slug=None): # meta is a dictionary that contains all the attributes in the markdown file (ex: title, description, soup, etc) # content is the body of the md file aka the text content @@ -107,7 +114,7 @@ def dynamic_page(slug=None): # Single project -@app.route(f"/{base_url}/projects//") +@app.route("/projects//") def p_info(project=None): meta, content = get_md_contents("documentation.md", f"./{projects}/{project}") @@ -117,18 +124,19 @@ def p_info(project=None): return render_template(template, **meta, content=content) -@app.route(f'/{base_url}/projects//') +@app.route('/projects//') def sendStaticFiles(project, filename): return send_from_directory(app.root_path + f'/projects/{project}/', filename, conditional=True) -@app.route(f'/{base_url}/hook/', methods=['GET', 'POST']) +@app.route('/hook/', methods=['GET', 'POST']) def pull(): if request.method == 'POST': subprocess.call(['sh', '/home/kamo/public_html/update.sh']) with open('log.txt', 'a') as f: f.write(request.form['payload']) + print(request.form['payload']) render_home() @@ -136,5 +144,10 @@ def pull(): return 'GET method not supported' +@app.route('/api/render') +def render(): + render_home() + return 'rendered' + # RUN -app.run(port="3132") +app.run(port="3132", debug=True) diff --git a/render.html b/render.html index e69de29..f212b8e 100644 --- a/render.html +++ b/render.html @@ -0,0 +1,2703 @@ + + + + + + + Kamo - Documentation workout + + + + + + + + + + + + + + +
+ +
+

Documentation workout

+

Hello these are some logs from kamo. I like to develop software to inhabit complexity with visual and performative outcomes. You can find here a lot of works in progress and some finished projects. My resolution for these 2 years is to get good in documenting things I do. +So this is basically workout.

+

Ciao

+

TO DO

+
    +
  • Dark mood
  • +
  • Fix chat reader
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ + Thesis Draft + +

+
+ + Outline for the thesis + +
+
+ + GRS + + Research + + Writing + + + + 03 Nov, 22 + +
+

+ + Birthday Card + +

+
+ + draw your own b-day cards + +
+
+ + Web + + + + 30 Oct, 22 + +
+

+ + Graduation Project Proposal + +

+
+ + The secret plan to graduate + +
+
+ + GRS + + Research + + Writing + + + + 08 Oct, 22 + +
+

+ + soup2 + +

+
+ + notes for the next documentation workout + +
+
+ + CMS + + Diary + + Doc + + + + 21 Sep, 22 + +
+

+ + Frana Futura + +

+
+ + A documentary about environmental fragility of coastal Italy + +
+
+ + Documentary + + + + 21 Sep, 22 + +
+

+ + GRS + +

+
+ + Graduate Research Seminar 2022-2023 + +
+
+ + GRS + + Research + + Writing + + + + 21 Sep, 22 + +
+

+ + OOC - Summer Session - V2 + +

+
+ + Dev log for Object Oriented Choreography + +
+
+ + Performance + + VR + + Web + + + + 07 Jul, 22 + +
+

+ + Padliography 2 + +

+
+ + A way to keep track of our pads + +
+
+ + Pad + + Tool + + Utility + + + + 30 Jun, 22 + +
+

+ + textoscope + +

+
+ + Write and modulate different levels of textuality + +
+
+ + Text + + Web + + XML + + + + 03 Jun, 22 + +
+

+ + Kiwiboat + +

+
+ + Working with the Media Wiki API + +
+
+ + Python + + Web + + Wiki + + + + 01 Jun, 22 + +
+

+ + Workbook + +

+
+ + modular workbook for modular synths + +
+
+ + CMS + + Sound + + Web + + + + 28 May, 22 + +
+

+ + SI18.05 - What is right not to + +

+
+ + Vocal drum machine for the weekly issue release with Em + +
+
+ + SI18 + + Sound + + Text + + + + 22 May, 22 + +
+

+ + Graduation Divination + +

+
+ + Spiritual consultation for writing the thesis + +
+
+ + Grad + + Writing + + + + 16 May, 22 + +
+

+ + 🇯🇵 WORKINON + +

+
+ + Shared archive to keep track of how ideas change during research + +
+
+ + API + + Community + + Web + + + + 14 May, 22 + +
+

+ + Documentation Template + +

+
+ + Handy template for documenting projects + +
+
+ + Docu + + Python + + Tool + + + + 14 May, 22 + +
+

+ + SI18.03 - Emergent Opera + +

+
+ + Ok let's write an opera in 1 week altogether + +
+
+ + SI18 + + Sound + + + + 10 May, 22 + +
+

+ + SI18.03 - Overture Atlas + +

+
+ + blurring the borders of our contribution and call for external intervention + +
+
+ + SI18 + + Sound + + Tool + + + + 08 May, 22 + +
+

+ + Word dimmer + +

+
+ + A tool to navigate words semantically + +
+
+ + Python + + Text + + Tool + + + + 29 Apr, 22 + +
+

+ + Plotter Pattern + +

+
+ + Parametric graphics to be plotted with the plotter + +
+
+ + CG + + Print + + vvvv + + + + 25 Apr, 22 + +
+

+ + SI18.02 - Schooling Shoaling + +

+
+ + An exploration of pattern entrances and exits + +
+
+ + Live + + SI18 + + Sound + + + + 24 Apr, 22 + +
+

+ + Notation system for 2 or + fingers + +

+
+ + Drawing and performing scores with Chae + +
+
+ + Drawings + + Notation + + Sound + + + + 20 Apr, 22 + +
+

+ + SI18.01 - Jingles + +

+
+ + Exploring the sequencer of the Skimmer to make some jjj + +
+
+ + SI18 + + Sound + + Tool + + + + 18 Apr, 22 + +
+

+ + Skimmer + +

+
+ + Hyper~panning and displaced speakers + +
+
+ + SI18 + + Sound + + Tool + + + + 13 Apr, 22 + +
+

+ + Soup to Wiki + +

+
+ + Teleport this log to the wiki (teleport not ready yet) + +
+
+ + Log + + Wiki + + + + 12 Apr, 22 + +
+

+ + Knob feast & Cables spaghetti hell + +

+
+ + Generate interactive synth panel from SVG + +
+
+ + Interaction + + Prototype + + Web + + + + 11 Apr, 22 + +
+

+ + Spaghetti + +

+
+ + Hand drawn SVG cables for a modular interaction + +
+
+ + SVG + + Web + + + + 11 Apr, 22 + +
+

+ + Deciduous Time Everlasting Internet + +

+
+ + Design the lifespan of a website + +
+
+ + Web + + Workshop + + + + 01 Apr, 22 + +
+

+ + SI17 Homepage + +

+
+ + A simple static website to host the loot box + +
+
+ + SI17 + + Web + + + + 22 Mar, 22 + +
+

+ + Post-it Visual Identity + +

+
+ + How to deliver a pubblication in post-it format + +
+
+ + SI17 + + Visual + + + + 20 Mar, 22 + +
+

+ + we printed 85 000 postit for real + +

+
+ + Web-to-print post-it generator app + +
+
+ + Print + + SI17 + + Web + + + + 15 Mar, 22 + +
+

+ + Post-it Contents + +

+
+ + A repo to organize SI17 contents in a post-it guise + +
+
+ + SI17 + + + + 10 Mar, 22 + +
+

+ + Post it generator + +

+
+ + Prototype for web-to-print postit + +
+
+ + Print + + SI17 + + Web + + + + 08 Mar, 22 + +
+

+ + Chameleon RRPG 🦎 + +

+
+ + A Random Role Play Game to inject micro scripted actions in daily life + +
+
+ + Games + + + + 01 Mar, 22 + +
+

+ + test static files in project directory + +

+
+ + it's a test + +
+
+ + NGINX + + Test + + Web + + + + 21 Feb, 22 + +
+

+ + SI17 producing the public + +

+
+ + homeworks for 21/02 + +
+
+ + SI17 + + + + 18 Feb, 22 + +
+

+ + Chaotic evil puzzles + +

+
+ + Jigsaw puzzle as a form of encryption of our SI17 + +
+
+ + Games + + Proposal + + SI17 + + + + 18 Feb, 22 + +
+

+ + Flask that soup 🥥 + +

+
+ + Confy Flask setup on the Soupboat + +
+
+ + Python + + Web + + + + 15 Feb, 22 + +
+

+ + 🥐 XQUISITE BRUNCH 🥐 + +

+
+ + A branching take on the exquisite corpse game + +
+
+ + Games + + Python + + Web + + + + 13 Feb, 22 + +
+

+ + Loot Box as a Decorator + +

+
+ + Hermit crab in the book store + +
+
+ + Games + + Research + + SI17 + + + + 11 Feb, 22 + +
+

+ + A Katamari Fanfiction + +

+
+ + What's left when you roll on everything? + +
+
+ + Games + + SI17 + + Text + + + + 09 Feb, 22 + +
+

+ + Mimic research 📦 + +

+
+ + Exploring a tricky treasure trope + +
+
+ + Games + + Research + + SI17 + + + + 04 Feb, 22 + +
+

+ + LOOT—BOX—SEALING—DEVICE + +

+
+ + Closing Pandora's 3D large jar + +
+
+ + Games + + Proposal + + SI17 + + + + 04 Feb, 22 + +
+

+ + Multi Player Loot Box + +

+
+ + Notes to generate relations within the public + +
+
+ + Games + + Research + + SI17 + + + + 04 Feb, 22 + +
+

+ + Temporality of the loot box + +

+
+ + Against instant rewarding + +
+
+ + Games + + Research + + SI17 + + + + 01 Feb, 22 + +
+

+ + Soupboat CMS 00 + +

+
+ + Micro JSON→HTML CMS for the first trimester + +
+
+ + CMS + + JS + + + + 24 Dec, 21 + +
+

+ + SI16 Backend + +

+
+ + Flexible Flask app (~) for the SI16 API + +
+
+ + Python + + SI16 + + Web + + + + 16 Dec, 21 + +
+

+ + Annotation Compass + +

+
+ + A tool for gathering situated impressions in order to create individual, vernacular and poetic readings of various inputs + +
+
+ + Label + + SI16 + + Tool + + Web + + + + 10 Dec, 21 + +
+

+ + Spawn Sticker + +

+
+ + simple & flexible & adhesive + +
+
+ + JS + + SI16 + + Web + + + + 09 Dec, 21 + +
+

+ + SI16 Frontend Proposal + +

+
+ + Proposal for the SI16 website + +
+
+ + Design + + SI16 + + Web + + + + 08 Dec, 21 + +
+

+ + SI16 Structure Proposal + +

+
+ + Imaging the SI16 as an API ecosystem + +
+
+ + Proposal + + SI16 + + + + 15 Nov, 21 + +
+

+ + SI16 API node.js + express prototype + +

+
+ + Test for an API-based special issue + +
+
+ + API + + REST + + SI16 + + Web + + + + 14 Nov, 21 + +
+

+ + SI16 API Strapi-Nuxt prototype + +

+
+ + Test for a node.js backend for the SI16 app + +
+
+ + API + + JS + + + + 10 Nov, 21 + +
+

+ + Chimeric API + +

+
+ + What Can API Learn from Poetics and World-building? + +
+
+ + API + + + + 10 Nov, 21 + +
+

+ + Concrete 🎏 Label + +

+
+ + A tool for annotating visual contents + +
+
+ + Label + + Text + + Tool + + Web + + + + 01 Nov, 21 + +
+

+ + 🏓 PADliography + +

+
+ + Fetching all our pads from the PZI wiki with API magic + +
+
+ + CMS + + Long Term + + Utility + + Web + + + + 28 Oct, 21 + +
+

+ + Pimp the Soupboat WS + +

+
+ + Crash HTML_CSS workshop for our dear XPUB1 fellows + +
+
+ + Web + + Workshop + + + + 28 Oct, 21 + +
+

+ + 🎵 K-PUB + +

+
+ + Karaoke as a mean of republishing + +
+
+ + Event + + Long Term + + Text + + vvvv + + + + 21 Oct, 21 + +
+

+ + 🥣 Soup-gen + +

+
+ + A soup aggregator for the next 2 years + +
+
+ + CMS + + Long Term + + Web + + + + 19 Oct, 21 + +
+

+ + Rejection 🧠⛈️ + +

+
+ + Round glossary just for fun ok + +
+
+ + Process + + SI16 + + + + 19 Oct, 21 + +
+

+ + Cam Transcript + +

+
+ + 10 minutes transcription from Insecam webcams + +
+
+ + Text + + Video + + + + 12 Oct, 21 + +
+

+ + Chat Reader + +

+
+ + Transform a text (ok no, actually a CSV file) into a chat + +
+
+ + Chat + + JS + + Text + + + + 06 Oct, 21 + +
+

+ + Text Weaving + +

+
+ + Weave two texts, like warp and weft + +
+
+ + NLTK + + Python + + Text + + + + 05 Oct, 21 + +
+

+ + Text ⛵ Lifeboats + +

+
+ + What if we could use some excerpts from all of what we are reading now as lifeboats in a sea of text? + +
+
+ + JS + + Text + + + + 28 Sep, 21 + +
+
+ + \ No newline at end of file diff --git a/templates/.ipynb_checkpoints/base-checkpoint.html b/templates/.ipynb_checkpoints/base-checkpoint.html deleted file mode 100644 index 04ee9f3..0000000 --- a/templates/.ipynb_checkpoints/base-checkpoint.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - {% block title %} - {{ title }} {% endblock %} - - - - - - - - - - - - - {% block head %}{% endblock %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

{{ title }}

- {% block header %} {% endblock %} -
-
{%block content%} {% endblock %}
- - diff --git a/templates/.ipynb_checkpoints/cards-checkpoint.html b/templates/.ipynb_checkpoints/cards-checkpoint.html deleted file mode 100644 index f0b612b..0000000 --- a/templates/.ipynb_checkpoints/cards-checkpoint.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "project.html" %} - -{% block cover%} -
- {% for card in cards %} - - {%endfor%} -
-{% endblock %} \ No newline at end of file diff --git a/templates/.ipynb_checkpoints/home-checkpoint.html b/templates/.ipynb_checkpoints/home-checkpoint.html deleted file mode 100644 index bc9b620..0000000 --- a/templates/.ipynb_checkpoints/home-checkpoint.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - Kamo {% block title %} - {{ title }} {% endblock %} - - - - - - - - - - - - - - -
- -
-

{{ title }}

-
{{content|safe}}
-
- - - {% for project in projects %} - - - - - - - {% endfor %} -
-

- - {{project.title}} - -

-
- {% if project.description %} - {{ project.description }} - {% endif %} -
-
- {% for category in project.categories %} - {{category}} - {% endfor %} - - {% if project.date %} - {{project.date}} - {% endif %} -
-
- - \ No newline at end of file diff --git a/templates/.ipynb_checkpoints/page-checkpoint.html b/templates/.ipynb_checkpoints/page-checkpoint.html deleted file mode 100644 index c66b78e..0000000 --- a/templates/.ipynb_checkpoints/page-checkpoint.html +++ /dev/null @@ -1,42 +0,0 @@ -{% extends "base.html" %} - - -{% block head %} - - - {% if css %} - - {% endif %} - - {% if script %} - - {% endif %} - - -{% endblock %} - - - -{% block title %} - {{title}} -{% endblock %} - -{% block nav %} - Back -{% endblock %} - - -{% block content%} - - {% if cover %} - {{cover_alt}} - {% endif %} - - - {{ content|safe }} -{% endblock %} diff --git a/templates/.ipynb_checkpoints/project-checkpoint.html b/templates/.ipynb_checkpoints/project-checkpoint.html deleted file mode 100644 index 9323379..0000000 --- a/templates/.ipynb_checkpoints/project-checkpoint.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - {{ title }} - - - - - - - - - - - - - - - {% if css %} - - {% endif %} - - - - - - - - - {% if script %} - - {% endif %} - - - - {% if description %} - - - - {% endif %} - - {% if cover %} - - - {% endif %} - - - - -
- - {% block cover %} - {% if cover and cover_alt %} -
- {{cover_alt}} -
- {% endif %} - {% endblock %} -

{{ title }}

- - - - -
- {% for category in categories %} - - {{category}} - - {% endfor %} -
- -
- - - - -
- - {{content|safe}} - -
- - diff --git a/templates/page.html b/templates/page.html index c66b78e..3bfb7f9 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,42 +1,18 @@ {% extends "base.html" %} -{% block head %} - - - {% if css %} - - {% endif %} - - {% if script %} - - {% endif %} - - -{% endblock %} - +{% block head %} {% if css %} + +{% endif %} {% if script %} + +{% endif %} {% endblock %} -{% block title %} - {{title}} -{% endblock %} - -{% block nav %} - Back +{% block title %} {{title}} {% endblock %} {% block nav %} +Back {% endblock %} -{% block content%} - - {% if cover %} - {{cover_alt}} - {% endif %} - - - {{ content|safe }} -{% endblock %} +{% block content%} {% if cover %} +{{cover_alt}} +{% endif %} {{ content|safe }} {% endblock %}