Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.1k stars 106 forks source link

Resources generate white-lines in output of cell #228

Open jbaron opened 3 years ago

jbaron commented 3 years ago

Small cosmetic issue: right now when I define resources like CSS and JS (I'm using the JupyterIntegration approach), they get rendered correctly so they are available to my notebook.

However the display of the the rendered HTML elements for these resources is not set to none. So they actually add an extra white-line to the output of that cell. Would be nice if they would be added without showing up as a white-line.

P.S perhaps important to note I'm using using Jupyter-lab, so everything gets in-lined not isolated/i-framed.

ileasile commented 3 years ago

Thanks, @jbaron! It's a known issue, but I don't know what to do with it for now. I will look more closely when I have time.

ileasile commented 3 years ago

Note. There is a div with outputWrapper class in Classic and jp-Cell-outputWrapper class in Lab that holds the cell outputs. When any outputs are added to the cell, div with outputArea class is created, and it has non-zero margin and/or padding. So we may add a JS which sets, i.e., display="none" to the corresponding div.

jbaron commented 3 years ago

jp-Cell-outputWrapper could contain other content that you don't want to hide.

When I tried manually inthe browser, had to set display to None on the following type of element:

<div class="lm-Widget p-Widget lm-Panel p-Panel jp-OutputArea-child">

And of course you can only do that if contains this generated output with JS and CSS and not as a generic CSS rule. With modern CSS 4 this should be possible, otherwise need some library like JQuery to help out.