Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
)
9 changes: 7 additions & 2 deletions sphinxcontrib/jupyter/writers/convert.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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']

Expand All @@ -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):
Expand Down