From 8ce32133e75e6a78611b509b27db4f2fbdc73b87 2013-11-14 01:14:25 From: Peter Davis Date: 2013-11-14 01:14:25 Subject: [PATCH] Add strip_url_static_file to base sphinx template and templateexporter.py --- diff --git a/IPython/nbconvert/exporters/templateexporter.py b/IPython/nbconvert/exporters/templateexporter.py index e50bd36..eaf5c60 100644 --- a/IPython/nbconvert/exporters/templateexporter.py +++ b/IPython/nbconvert/exporters/templateexporter.py @@ -61,6 +61,7 @@ default_filters = { 'citation2latex': filters.citation2latex, 'path2url': filters.path2url, 'add_prompts': filters.add_prompts, + 'strip_url_static_file_prefix': filters.strip_url_static_file_prefix, } #----------------------------------------------------------------------------- diff --git a/IPython/nbconvert/templates/latex/latex_base.tplx b/IPython/nbconvert/templates/latex/latex_base.tplx index 0ad51fa..361f0b6 100644 --- a/IPython/nbconvert/templates/latex/latex_base.tplx +++ b/IPython/nbconvert/templates/latex/latex_base.tplx @@ -202,7 +202,7 @@ This template does not define a docclass, the inheriting class must define this. ((* elif cell.level == 6 -*)) ((* block h6 -*))\\*\textit((* endblock h6 -*)) ((*- endif -*)) - {((( cell.source | replace('\n', ' ') | citation2latex | markdown2latex )))} + {((( cell.source | replace('\n', ' ') | citation2latex | strip_url_static_file_prefix | markdown2latex )))} ((* endblock headingcell *)) @@ -215,7 +215,7 @@ This template does not define a docclass, the inheriting class must define this. % Render markdown ((* block markdowncell scoped *)) - ((( cell.source | citation2latex | markdown2latex ))) + ((( cell.source | citation2latex | strip_url_static_file_prefix | markdown2latex ))) ((* endblock markdowncell *)) % Spit out the contents of raw cells unmodified