From 65a33c20fe73231b8f8678122fd03a2e7eef85af Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sun, 3 Nov 2019 17:06:52 +0000 Subject: [PATCH] Update template name changed in nbconvert development version (#344) * Update template name changed in nbconvert development version * Get default template name from nbconvert --- src/nbsphinx.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nbsphinx.py b/src/nbsphinx.py index 383688eb..d57cddd8 100644 --- a/src/nbsphinx.py +++ b/src/nbsphinx.py @@ -73,8 +73,10 @@ 'text/plain', ) +# The default rst template name is changing in nbconvert 6, so we substitute +# it in to the *extends* directive. RST_TEMPLATE = """ -{% extends 'rst.tpl' %} +{% extends '__RST_DEFAULT_TEMPLATE__' %} {% macro insert_empty_lines(text) %} {%- set before, after = text | get_empty_lines %} @@ -288,7 +290,7 @@ {% endif %} {{ super() }} {% endblock footer %} -""" +""".replace('__RST_DEFAULT_TEMPLATE__', nbconvert.RSTExporter().template_file) LATEX_PREAMBLE = r"""