fixes embedding for jupyter-sphinx, and code is a bit more general to enable custom embedding as in ipyvolume
fixes embedding for jupyter-sphinx, and code is a bit more general to enable custom embedding as in ipyvolume

jupyter-widgets/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets