diff --git a/notebook/nbconvert/handlers.py b/notebook/nbconvert/handlers.py index 43fe5c9ca..8d8792d73 100644 --- a/notebook/nbconvert/handlers.py +++ b/notebook/nbconvert/handlers.py @@ -98,7 +98,8 @@ class NbconvertFileHandler(IPythonHandler): "name": name[:name.rfind('.')], "modified_date": (model['last_modified'] .strftime(text.date_format)) - } + }, + "config_dir": self.application.settings['config_dir'], } ) except Exception as e: @@ -132,7 +133,10 @@ class NbconvertPostHandler(IPythonHandler): nbnode = from_dict(model['content']) try: - output, resources = exporter.from_notebook_node(nbnode) + output, resources = exporter.from_notebook_node(nbnode, resources={ + "metadata": {"name": name[:name.rfind('.')],}, + "config_dir": self.application.settings['config_dir'], + }) except Exception as e: raise web.HTTPError(500, "nbconvert failed: %s" % e) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index ae35039fa..64113d1a3 100644 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -207,6 +207,7 @@ class NotebookWebApplication(web.Application): websocket_url=ipython_app.websocket_url, mathjax_url=ipython_app.mathjax_url, config=ipython_app.config, + config_dir=ipython_app.config_dir, jinja2_env=env, terminals_available=False, # Set later if terminals are available )