Printing a livebook

I’ve used livebook to pull together some statistics and VegaLite graphs for a research project, and now I’m wondering about how to best share this notebook alongside the published paper. I was expecting a similar level of friction as with sharing Jupyter notebooks: some readers will be able to fork my repository and run the notebook locally or on a cloud provider, but IMHO casual readers should be able to passively see the code and its outputs.

What I found is that some major hosts such as Github are correctly mapping .livemd to render as Markdown, but the outputs are formatted badly and special content such as VegaLite images will not be included when viewed this way (example livebook on Github). As a workaround, I’d like to export the livebook as a PDF and include that in the repo—this is easy in Jupyter, for example. Unfortunately, livebook is built in such a way that both Firefox and Chromium can export only the first page, apparently because the content is within a scrolling container. Are there any other methods of exporting the content so it can be used by casual readers?

Screenshot attached:

2 Likes

Lightly poking at the issues, I think much of it can be solved with small adjustments to @media print styling, for example expanding the main frame to its full height. But VegaLite integration needs deeper changes, it currently places its output using a fragile, absolute-positioned iframe.

And now I’m just parroting the findings from open issue Explore print.css · Issue #605 · livebook-dev/livebook · GitHub which suggests I have a valid use case and gives me some ideas—I’ll close this topic and take myself over there…