test toast

main
km0 2 years ago
commit 637fb9bba5

2
.gitignore vendored

@ -0,0 +1,2 @@
venv/
__pycache__

@ -0,0 +1,5 @@
# flat bonfire framework
![fuoco](cover.jpg)
A small framework to document project on the soupboat using a shared flat markup list as source.

@ -0,0 +1,24 @@
import os
from flask import Flask, render_template
from prefix import PrefixMiddleware
from flat import parse
from dotenv import load_dotenv
load_dotenv()
prefix = os.environ.get("URL_PREFIX", '')
port = os.environ.get("PORT", 3000)
debug = os.environ.get("DEBUG", True)
fireplace = os.environ.get("FIREPLACE", 'list.1dl')
app = Flask(__name__)
app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix=prefix)
@app.route('/')
def bonfire():
content = parse(fireplace)
return render_template('bonfire.html', content=content)
app.run(port=port, debug=debug)

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

@ -0,0 +1,53 @@
import re
def syntax():
'''regex setup for the flat syntax'''
# titles
t = re.compile('\(.*\)')
# sections
s = re.compile('\[(.*?)\]')
# notes
n = re.compile('(-->)')
# comments
c = re.compile('(>>)')
return (t, s, n, c)
def parse(file):
with open(file, 'r') as f:
parsed = {}
current_title = ''
current_section = ''
t, s, n, c = syntax()
line = f.readline()
while line:
if not line.rstrip('\n'):
line = f.readline()
continue
# titles
if t.match(line):
current_title = line[1:-2]
parsed[current_title] = {}
line = f.readline()
continue
# sections
if s.match(line):
current_section = line[1:-2]
parsed[current_title][current_section] = ''
line = f.readline()
continue
# notes (TBD)
if n.match(line):
parsed[current_title][current_section] += line.rstrip(
'\n') + ' \n'
line = f.readline()
continue
# normal text
parsed[current_title][current_section] += line.rstrip('\n') + ' \n'
line = f.readline()
return parsed

@ -0,0 +1,152 @@
(bonfire)
[what]
A small framework to document projects on the soupboat using a shared flat markup list as source.
[where]
https://hub.xpub.nl/soupboat/bonfire/
(flask-example)
[what]
a tutorial for setting up a flask app in the soupboat
[where]
https://git.xpub.nl/manetta/flask-example
[doc]
Kamo and Chae are working on the documentation!
With drawings!
And a general overview.
(workbook)
[what]
A tool to keep track and annotate configurations for different instruments
to facilitate learning process
[where]
https://hub.xpub.nl/soupboat/workbook/
[doc]
organized in 6 parts
1. intro/overview
2. what/why, intentions
3. how to add a new instrument
4. how to add a new patch
5. how to add a new snippet
6. how to contribute in the development
https://hub.xpub.nl/soupboat/workbook/documentation
https://pad.xpub.nl/p/modcms_documentation
--> draft in progress
[dev]
main repo
https://git.xpub.nl/supisara/workbook
svg to interactive panel
https://git.xpub.nl/kamo/panel
cables system
https://git.xpub.nl/kamo/spaghetti
[links]
brainstorming pad
https://pad.xpub.nl/p/modcms
[refs]
reference for spaghetti cables system
https://hub.xpub.nl/soupboat/~kamo/projects/spaghetti/
reference for interactive panel generator
https://hub.xpub.nl/soupboat/~kamo/projects/panel/
(padliography2)
[what]
an interface to archive links on the wiki
mainly used for pads
several instances of the archive can be initialized
directly from the interface
so multiple archives can coexhist together
[where]
https://hub.xpub.nl/soupboat/padliography
[doc]
https://git.xpub.nl/kamo/pad-bis
https://pzwiki.wdka.nl/mediadesign/Padliography
[notes]
--> I'd like to see more memes, they help me understanding the process more
--> I like the toads
--> more images please!
--> I wouldn't mind having more of these side-notes, why some decisions have been made or should be made
--> Hi! Great documentation! I am not a developer. So why is the "development" section much easier to follow than the "quick start"?
--> nice tool, nice colors, clear layout, but curious to hear from the maker why it is an interesting tool to use and work with? What is interesting about it for you? Also, in which context did this tool emerge? How is it embedded in that context? How did this influence your choices? Is the tool referring to other tools, can you cite them in some way?
--> I think the syntax could be more accessible by writing shorter sentences, or sentences that only focus on 1 thing. I'll elaborate after lunch
[dev]
v2 -- current
https://git.xpub.nl/kamo/pad-bis
v1
https://git.xpub.nl/kamo/PADliography
(SI16 API)
[what]
Learning how to walk while catwaking
A set of functions to mess around with vernacular language processing
Published as a choral API
Sparse architecture
[doc]
A collective work where everyone contributed with some functions
Written in Python inside Jupiter Notebooks
And documented in the very same notebooks
With description, examples and references about input and output
And then aggregated together as endpoints for the API
Multiplayer approach to documentation
That means docs with diverse voices
maybe not always clear
but really interesting way of work collaboratively
--> we didn't managed but it could make sense in a process like this to have an editorial meeting at the beginning to align a bit the intentions and then an editorial review after, to adjust contents
Example:
Shout function
https://hub.xpub.nl/soupboat/si16/functions/shout/
More documentation for the backend is available
https://hub.xpub.nl/soupboat/~kamo/projects/si16-backend/
[where]
https://hub.xpub.nl/soupboat/si16/
[dev]
main repo
https://git.xpub.nl/grgr/si16-cat-walking/
[links]
si16 manifesto
https://hub.xpub.nl/soupboat/si16/intro/
si16 previous prototypes
https://hub.xpub.nl/soupboat/~kamo/projects/si16-API-strapi-nuxt-prototype/
https://hub.xpub.nl/soupboat/~kamo/projects/si16-API-express-prototype/
https://hub.xpub.nl/soupboat/~kamo/projects/si16-structure-proposal/
https://hub.xpub.nl/soupboat/~kamo/projects/si16-frontend-design/

@ -0,0 +1,15 @@
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()]

@ -0,0 +1,30 @@
html,
body {
font-family: sans-serif;
color: tomato;
background-color: #111;
}
pre {
font-family: sans-serif;
line-height: 1.4;
max-width: 60ch;
white-space: pre-wrap;
}
.work {
border: 1px solid currentColor;
display: inline-block;
width: auto;
padding: 0 16px;
}
main {
display: flex;
align-items: flex-start;
gap: 16px;
}
main > * {
flex: 1 0 60ch;
}

@ -0,0 +1,29 @@
<!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>Flat Bonfire Framework</title>
<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}" />
</head>
<body>
<h1>Documentation Bonfire</h1>
<main>
{% for key, entry in content.items() %}
<div class="work">
<h2>{{ key }}</h2>
{% for section, text in entry.items()%}
<section>
<h3>{{ section }}</h3>
<pre>{{ text}}</pre>
</section>
{% endfor %}
</div>
{% endfor %}
</main>
</body>
</html>
Loading…
Cancel
Save