Skip to content

Commit

Permalink
Switch to HTML mime bundle (#3574)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored and jlstevens committed Mar 26, 2019
1 parent 8d7f701 commit 5483be8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions holoviews/ipython/display_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from functools import wraps
from contextlib import contextmanager

import os, sys, traceback
import sys, traceback

import IPython
from IPython import get_ipython
Expand Down Expand Up @@ -142,20 +142,20 @@ def wrapped(element):
mimebundle = fn(element, max_frames=max_frames)
if mimebundle is None:
return {}, {}

html = mimebundle_to_html(mimebundle)
if os.environ.get('HV_DOC_HTML', False):
mimebundle = {'text/html': html}, {}
mime_data, mime_metadata = mimebundle
if 'text/javascript' in mime_data:
mime_data['text/html'] = mimebundle_to_html(mime_data)
del mime_data['text/javascript']

# Only want to add to the archive for one display hook...
disabled_suffixes = ['png_display', 'svg_display']
if not any(fn.__name__.endswith(suffix) for suffix in disabled_suffixes):
if type(holoviews.archive) is not FileArchive:
holoviews.archive.add(element, html=html)
holoviews.archive.add(element, html=mime_data['text/html'])
filename = OutputSettings.options['filename']
if filename:
Store.renderers[Store.current_backend].save(element, filename)
return mimebundle
return mime_data, mime_metadata
except SkipRendering as e:
if e.warn:
sys.stderr.write(str(e))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


setup_args = {}
install_requires = ['param>=1.8.0,<2.0', 'numpy>=1.0', 'pyviz_comms>=0.7.0']
install_requires = ['param>=1.8.0,<2.0', 'numpy>=1.0', 'pyviz_comms>=0.7.2']

extras_require = {}

Expand Down

0 comments on commit 5483be8

Please sign in to comment.