documentation

master
km0 2 years ago
parent e8d6d740cb
commit 364d804d7b

@ -73,7 +73,7 @@ def get_recipes():
recipes.append(meta) recipes.append(meta)
return recipes return recipes
# post the recipe in the wiki
def update_wiki(recipe): def update_wiki(recipe):
import mwclient import mwclient
@ -85,7 +85,6 @@ def update_wiki(recipe):
page = site.pages['Week Six: Diffractive reading methods'] page = site.pages['Week Six: Diffractive reading methods']
text = page.text() text = page.text()
steps = '\n'.join([f"# {log}" for log in recipe["logs"]]) steps = '\n'.join([f"# {log}" for log in recipe["logs"]])
# PROV TEMPLATE # PROV TEMPLATE
@ -105,21 +104,11 @@ def update_wiki(recipe):
{recipe['who']} {recipe['who']}
""" """
# mi disp # delete multiline indentation
text += '\n'.join([line.strip() for line in content.splitlines()]) text += '\n'.join([line.strip() for line in content.splitlines()])
page.edit(text, f'Added a new recipe! {recipe["title"]}') page.edit(text, f'Added a new recipe! {recipe["title"]}')
# sample object to test the md output
r = {
"title": "Test test test",
"description": "A super simple description",
"logs": ["first step", "second step", "third step"],
"who": "a friend of mine",
}
# TODO: get data from client # TODO: get data from client
@app.route("/", methods=["GET", "POST"]) @app.route("/", methods=["GET", "POST"])

@ -1,10 +0,0 @@
---
date: 2022-05-31 01:38:40.484897
description: A super simple description
logs:
- first step
- second step
- third step
title: Test test test
who: a friend of mine
---
Loading…
Cancel
Save