From f84556c1ef2d842a7cdf65549dd521a33412c13c Mon Sep 17 00:00:00 2001 From: "kam (from the studio)" Date: Wed, 7 Dec 2022 20:46:33 +0100 Subject: [PATCH] list of lists --- main.py | 30 +++++++++++- static/style.css | 17 +++++++ templates/home.html | 18 +++++++ txt/brainstorm.md | 90 ++++++++++++++++++++++++++++++++++ list.md => txt/situated_doc.md | 0 5 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 templates/home.html create mode 100644 txt/brainstorm.md rename list.md => txt/situated_doc.md (100%) diff --git a/main.py b/main.py index 33ffdda..6613ec7 100644 --- a/main.py +++ b/main.py @@ -9,13 +9,39 @@ prefix = os.environ.get('URL_PREFIX', '') port = os.environ.get('PORT', '3000') debug = os.environ.get('DEBUG', 'False') + +def list_files(folder, remove_ext=False): + ''' Read all the functions in a folder ''' + names = [] + for entry in os.scandir(folder): + # add to the list only proper files + if entry.is_file(follow_symlinks=False): + # remove the extension from the filename + n = entry.name + if remove_ext: + n = os.path.splitext(entry.name)[0] + names.append(n) + return names + + + + app = Flask(__name__) app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix=prefix) +@app.route('/favicon.ico') +def favicon(): + return send_from_directory(os.path.join(app.root_path, 'static'), + 'favicon.ico', mimetype='image/vnd.microsoft.icon') @app.route('/') -def list(): - with open('list.md',"r") as f: +def home(): + listos = list_files('txt', True) + return render_template('home.html', listos = listos) + +@app.route('/') +def list(slug): + with open(f'txt/{slug}.md',"r") as f: text = f.read() list = markdown(text) return render_template('list.html', list = list) diff --git a/static/style.css b/static/style.css index 4e5b06d..0b65478 100644 --- a/static/style.css +++ b/static/style.css @@ -67,3 +67,20 @@ em { code { background-color: #eee; } + +.home-list { + list-style: default; +} + +.home-list li { + display: block; +} + +.home-list li:after { + content: none; +} + +.home-list a { + color: currentColor; + text-transform: capitalize; +} diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..4c48e17 --- /dev/null +++ b/templates/home.html @@ -0,0 +1,18 @@ + + + + + + + + list list + + +

List of lists

+ + + diff --git a/txt/brainstorm.md b/txt/brainstorm.md new file mode 100644 index 0000000..4d5e20f --- /dev/null +++ b/txt/brainstorm.md @@ -0,0 +1,90 @@ +- Create a space +- to host a list of resources +- to explore the documentation of coding related practices +- for situated software +- and articulate it as a form of care + +
+ +- Target public +- people in small communities that deal with software +- _Examples_ +- Soupboat +- Breadcube +- XPUB +- Varia +- OSP +- Konstant +- Autonomic +- 100R +- etc + +
+ +- Why a space? +- Why a list? +- Why resources? +- Why not just a manual on how to write the perfect software documentation? + +
+ +- It's tricky! + +
+ +- There is no such a thing as a magic solution for perfect documentation +- While there are documentation frameworks that help naming and structuring things, these usually cover just generic approach for technical writing +- Situated software has more to offer than a generic approach +- sprouting from specific contexts +- it can depend on particular knowledges and skills +- that differ in each community + +
+ +- This diversity means manifold of ideas and ways to document +- Hence a list of resources +- Someone would call it site specific software +- someone else situated knowledges + +
+ +- Different resources come from different communities +- It is not guaranted for them to be interchangeable +- nor to be effective or either meaningful for everyone else +- Yet, to be together in this list could be a way to interfere with each other +- To create perspective and inspire new strategies + +
+ +- So the need for a space where to host the list +- What are the feature of this space? +- Open to contributions +- A bit structured +- A bit loose +- Is it a platform? +- Could it be something different than a website? +- Could it work without browser's technology? +- Could it have less environmental impact? +- Could it be simple and lightweight? +- Could it inhabit existing documentations? +- A strange hyper tagging system? + +
+ +- _Idea_ +- Federated list +- should it follow the concepts of the Fediverse? +- several instances of this list +- growing from specific groups or cluster of groups +- each community curates it's own list +- this is interesting +- is it different from a normal feed? +- yes +- because the contents are curated +- not just aggregated +- how is it structured? +- each instance has a server +- and offer access for clients +- _again_ could this be something different than a website? +- actually and ideally +- every instance could decide on the form diff --git a/list.md b/txt/situated_doc.md similarity index 100% rename from list.md rename to txt/situated_doc.md