adamwight

adamwight

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:

Most Liked

adamwight

adamwight

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…

Where Next?

Popular in Questions Top

aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement