def notebook(notebook): try: notebook = nbf.read(open('notebooks/%s' % notebook, 'r'), 'ipynb') except IOError: abort(418) html_notebook= convert_nb_html(notebook) return render_template('notebook.html', content=html_notebook)
def notebook(notebook): try: notebook = nbf.read(open('notebooks/%s' % notebook, 'r'), 'ipynb') except IOError: abort(418) html_notebook = convert_nb_html(notebook) return render_template('notebook.html', content=html_notebook)
def adder(): """ Inject input parameters to the adder notebook before rendering """ if request.method == 'POST': notebook = nbf.read(open('notebooks/adder.ipynb', 'r'), 'ipynb') notebook = inject_params(request.form, notebook) html_notebook = convert_nb_html(notebook) return render_template('notebook.html', content=html_notebook) else: params = forms.AdderForm() return render_template('adder.html', form=params)