diff --git a/nb2plots/from_notebook.py b/nb2plots/from_notebook.py index 754712b..886887e 100644 --- a/nb2plots/from_notebook.py +++ b/nb2plots/from_notebook.py @@ -13,8 +13,8 @@ # Template to label code and output and plot blocks -dl = DictLoader({'rst_plots.tpl': """\ -{%- extends 'rst.tpl' -%} +dl = DictLoader({'rst_plots.tpl': r"""\ +{%- extends '__RST_DEFAULT_TEMPLATE__' -%} {% block input %} {%- if cell.source.strip() | has_mpl_inline -%} @@ -50,7 +50,8 @@ {{ output.data['text/plain'] | ellipse_mpl | indent }} ##END_OUT_END## {%- endblock data_text -%} -"""}) +""".replace('__RST_DEFAULT_TEMPLATE__', + nbconvert.RSTExporter().template_file)}) def has_mpl_inline(code):