ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.24k stars 807 forks source link

html printview template #1379

Open xiyuanbao opened 5 years ago

xiyuanbao commented 5 years ago

I am trying to export notebook using printview with nbconvert option: --template=nbextensions --to=html but the output of x3d object generated by mayavi cannot show properly in converted html, I compared the source code of notebook page and printed html and realize those end tags are missing in the latter one, can anyone tell me what to modify and how to modify to get rid of this? Thank you very much!

Here is the segment with all end tags and it is working: <directionallight direction="0 -6.12323e-17 -1" color="1 1 1" intensity="1" on="true" shadowmapsize="1024" znear="-1" zfar="-1" shadowcascades="1" shadowsplitfactor="1" shadowsplitoffset="0.1"></directionallight>

Here is the segment without end tags : <directionallight direction="0 -6.12323e-17 -1" color="1 1 1" intensity="1" on="true" shadowmapsize="1024" znear="-1" zfar="-1" shadowcascades="1" shadowsplitfactor="1" shadowsplitoffset="0.1">

juhasch commented 5 years ago

You can try modifying the Jinja template nbextensions.tpl. Best is to rename it when playing around, so you know you use your modified template.

Documentation for nbconvert template can be found here

xiyuanbao commented 5 years ago

Thank you very much @juhasch ! But unluckily I still don't know how to modify it after reading the doc...

xiyuanbao commented 5 years ago

I was wrong before, the ending tags are not missing but at wrong position; Tags can be closed normally until x3d->scene, as is shown below: image But inside scene, when the tags should be parallel: screen shot 2019-01-08 at 1 14 02 pm the output html treats them with different level: screen shot 2019-01-08 at 1 16 26 pm