Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created June 22, 2016 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/5d9533271135cbec399e6c940f88ebec to your computer and use it in GitHub Desktop.
Save whatalnk/5d9533271135cbec399e6c940f88ebec to your computer and use it in GitHub Desktop.
jupyter nbconvert --to html で image を分ける
c = get_config()
c.Exporter.preprocessors = ['nbconvert.preprocessors.ExtractOutputPreprocessor']
c.ExtractOutputPreprocessor.extract_output_types = {'image/svg+xml'}
c.NbConvertApp.export_format = 'html'
c.Exporter.template_file = 'separate_image_html'
c.FilesWriter.build_directory = 'gh-pages'
{%- extends 'full.tpl' -%}
{% block data_svg scoped -%}
<div class="output_svg output_subarea {{extra_class}}">
<img src="{{ output.metadata.filenames['image/svg+xml'] | path2url }}"
</div>
{%- endblock data_svg %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment