From d91e74cc73d25342f10f7ed93a9d684cda443a12 Mon Sep 17 00:00:00 2001 From: jgart Date: Tue, 25 Jan 2022 13:29:38 -0500 Subject: use binderlite api to get jupyter notebooks dynamically --- wqflask/wqflask/jupyter_notebooks.py | 26 ++---------------------- wqflask/wqflask/templates/jupyter_notebooks.html | 12 ++++++----- 2 files changed, 9 insertions(+), 29 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/jupyter_notebooks.py b/wqflask/wqflask/jupyter_notebooks.py index fc3a0af3..08d9123d 100644 --- a/wqflask/wqflask/jupyter_notebooks.py +++ b/wqflask/wqflask/jupyter_notebooks.py @@ -5,27 +5,5 @@ jupyter_notebooks = Blueprint("jupyter_notebooks", __name__) @jupyter_notebooks.route("/launcher", methods=("GET",)) def launcher(): - links = ( - { - "main_url": "http://notebook.genenetwork.org/59373/notebooks/BXD%20Analysis.ipynb", - "notebook_name": "This shows how to model BXD mouse weight data using an AR(1) process", - "src_link_url": "https://github.com/BonfaceKilz/tsaf-analysis-of-bxd-mouse-colonies", - }, - { - "main_url": "http://notebook.genenetwork.org/53457/notebooks/2020-05-08/solberg-rat-analysis.ipynb", - "notebook_name": "Quantitative Genetics Tools for Mapping Trait Variation to Mechanisms, Therapeutics, and Interventions - Webinar Series", - "src_link_url": "https://github.com/senresearch/quant-genetics-webinars", - }, - { - "main_url": "http://notebook.genenetwork.org/34447/notebooks/genenetwork.ipynb", - "notebook_name": "Querying the GeneNetwork API declaratively with python.", - "src_link_url": "https://github.com/jgarte/genenetwork-jupyter-notebook-example", - }, - { - "main_url": "http://notebook.genenetwork.org/53923/notebooks/genenetwork-api-using-r.ipynb", - "notebook_name": "R notebook showing how to query the GeneNetwork API.", - "src_link_url": "https://github.com/jgarte/genenetwork-api-r-jupyter-notebook", - }, - ) - - return render_template("jupyter_notebooks.html", links=links) + links = requests.get("http://notebook.genenetwork.org/api") + return render_template("jupyter_notebooks.html", links=links.json()) diff --git a/wqflask/wqflask/templates/jupyter_notebooks.html b/wqflask/wqflask/templates/jupyter_notebooks.html index afc95a15..e3a01fe5 100644 --- a/wqflask/wqflask/templates/jupyter_notebooks.html +++ b/wqflask/wqflask/templates/jupyter_notebooks.html @@ -1,10 +1,12 @@ {%extends "base.html"%} + {%block title%} Jupyter Notebooks {%endblock%} {%block css%} + {%endblock%} @@ -15,11 +17,11 @@ Jupyter Notebooks {%for item in links:%} {%endfor%} -- cgit v1.2.3