mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
fix minor bugs in export as (nbconvert) example
This commit is contained in:
parent
17bbc2b360
commit
cdae251186
@ -20,6 +20,8 @@
|
||||
"from IPython.nbconvert import get_export_names, export_by_name\n",
|
||||
"from IPython.nbconvert.writers import FilesWriter\n",
|
||||
"from IPython.nbformat import current"
|
||||
"from IPython.nbconvert.utils.exceptions import ConversionException\n",
|
||||
|
||||
],
|
||||
"language": "python",
|
||||
"metadata": {},
|
||||
@ -151,7 +153,7 @@
|
||||
" download_link.value = \"<br>Results: <a href='files/{filename}'><i>\\\"{filename}\\\"</i></a>\".format(filename=write_results)\n",
|
||||
" download_link.visible = True\n",
|
||||
" \n",
|
||||
"def handle_export():\n",
|
||||
"def handle_export(widget):\n",
|
||||
" with open(filename, 'r') as f:\n",
|
||||
" export(filename, current.read(f, 'json'))\n",
|
||||
"export_button.on_click(handle_export)"
|
||||
|
Loading…
Reference in New Issue
Block a user