diff --git a/setup.py b/setup.py index 6f106ebb..a8be650d 100644 --- a/setup.py +++ b/setup.py @@ -67,6 +67,6 @@ platforms='any', packages=find_packages(), include_package_data=True, - install_requires=['docutils', 'nbformat', 'sphinx', 'dask', 'distributed', 'ipython', 'nbconvert', 'jupyter_client'], + install_requires=['docutils', 'nbformat', 'sphinx', 'dask', 'distributed', 'ipython', 'nbconvert', 'jupyter_client','sphinxcontrib-bibtex==1.0'], namespace_packages=['sphinxcontrib'], ) diff --git a/sphinxcontrib/jupyter/writers/convert.py b/sphinxcontrib/jupyter/writers/convert.py index bc4e043a..c10592ea 100644 --- a/sphinxcontrib/jupyter/writers/convert.py +++ b/sphinxcontrib/jupyter/writers/convert.py @@ -1,5 +1,6 @@ import nbformat -from nbconvert import HTMLExporter +import nbconvert +from nbconvert import HTMLExporter, TemplateExporter import os from io import open from sphinx.util.osutil import ensuredir @@ -16,6 +17,7 @@ def __init__(self, builderSelf): for path in [self.htmldir]: ensuredir(path) self.html_exporter = HTMLExporter() + self.template_exporter = TemplateExporter() templateFolder = builderSelf.config['jupyter_template_path'] @@ -25,7 +27,10 @@ def __init__(self, builderSelf): builderSelf.logger.warning("template directory not found") exit() - self.html_exporter.template_file = templateFolder + "/" + builderSelf.config["jupyter_html_template"] + if nbconvert.version_info < (6,0): + self.html_exporter.template_file = templateFolder + "/" + builderSelf.config["jupyter_html_template"] + else: + self.template_exporter.extra_template_basedirs.append(templateFolder + "/" + builderSelf.config["jupyter_html_template"]) def convert(self, nb, filename, language, base_path, path=None):