Put config_dir in resources in nbconvert handlers

CSSHTMLHeaderPreprocessor uses this to include the user's custom.css
in HTML output.

Closes gh-185
Thomas Kluyver 11 years ago
parent 26334946f9
commit 7e4354fbd9

@ -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)

@ -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
)

Loading…
Cancel
Save