diff --git a/cookbook.py b/cookbook.py index fe24547..02f158c 100644 --- a/cookbook.py +++ b/cookbook.py @@ -73,7 +73,7 @@ def get_recipes(): recipes.append(meta) return recipes - +# post the recipe in the wiki def update_wiki(recipe): import mwclient @@ -85,7 +85,6 @@ def update_wiki(recipe): page = site.pages['Week Six: Diffractive reading methods'] text = page.text() - steps = '\n'.join([f"# {log}" for log in recipe["logs"]]) # PROV TEMPLATE @@ -105,21 +104,11 @@ def update_wiki(recipe): {recipe['who']} """ - # mi disp + # delete multiline indentation text += '\n'.join([line.strip() for line in content.splitlines()]) - - 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 @app.route("/", methods=["GET", "POST"]) diff --git a/recipes/test-test-test_31-05-2022_01-38-40.md b/recipes/test-test-test_31-05-2022_01-38-40.md deleted file mode 100644 index e0a8865..0000000 --- a/recipes/test-test-test_31-05-2022_01-38-40.md +++ /dev/null @@ -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 ---- \ No newline at end of file