I'm developing a Jupyter kernel for Elm, and I would like users to be able to split their code over multiple code cells. To do this, I plan to let the kernel accumulate code from multiple cells without compiling it. Once it has received all of the code the should be compiled together, it will compile it and return the results.
What I haven't figured out yet is how to let users "mark" the last cell in a multi-cell example. One option is to have them insert a special comment (e.g. -- compile-cells
or something like that) that the kernel looks for, but this feels like a hack.
It seems like it would be more jupyter-esque to let the user set a metadata flag (probably via a helper extension) on cells which are at the end of an example. Setting metadata is easy enough, but I can't figure out how to access the metadata in the kernel.
So, is there a way to access cell metadata in the kernel? Specifically, I'm currently using the ipykernel.kernelbase.Kernel
base class for my kernel, so ideally I would be able to access the cell metadata from the do_execute
function.
If this is not possible, is there some other way I could accomplish the same thing?