Handle printing of documents in browser #1314
Background on the print media selector - https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Media.
If there is a CSS class applied to the currently active document, we could maybe do something like
I investigated the above solution and couldn't get it to work. Hiding not visible elements still leaves everything absolutely positioned by phosphor.
Then, I tried using creating an empty iframe, copying over the node we want to print into it, and calling print on the window. I used this library to do this: https://github.com/joseluisq/printd
That works for the JSON viewer, but doesn't work well for text editors or notebooks. For those, we need some custom functionality likely. For notebooks, we could use the To HTML functionality of nbconvert to get a nicer print preview.