Tried some different html text formatting, pretty ...
# datascience
j
Tried some different html text formatting, pretty cool that they all work on Notebook. What html rendering engine is it using under the hood?
a
A browser. Chromium embedded if you are talking about IDEA.
You can also combine the notebook with Kotlinx-html to have type-safe html generation experience.
j
Cool. Interestingly, it seems like if I have some CSS styles in the html, they are shared between all the HTML outputs of the different blocks
I'm not sure whether this is intended behavior. It could be cool for people to put a stylesheet on the top of the page and then print HTML below, but what is a little strange is that the stylesheet retroactively applies to html that has been printed previously as well
a
It depends on the engine. You need to understand that css and JS are part of the brouwser environment you run your cells in. There are two approaches to handling it: • cell isolation with separate scripts and JS for each cell (done as iframe or similar) • global context for the whole page (or even mulitple tabs. The problem with cell isolation is that you need to repeat custom scripts in each cell. This is especially problematic when your frontend is also written in Kotlin and not distributed via CDN. I had a lot of troubles with that in VisionForge. Currently, all notebook renderers work differently, which gives a lot of headache for integration developers. I hope that there will be kind of unified approach in future. Right now, the way it works in Jupyter Lab is the most robust.