Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Pluto
function plutostate_to_julia(state::Dict{Any, Any}, juliafile::AbstractString)
cell_order = UUID.(state["cell_order"])
cells_dict = Dict([UUID(k) => Pluto.Cell(cell_id=UUID(k), code=v["code"], code_folded=v["code_folded"]) for (k, v) state["cell_inputs"]])
cells = [cells_dict[id] for id cell_order]
nb = Pluto.Notebook(cells, "", uuid4())
open(juliafile, "w") do io
Pluto.save_notebook(io, nb)
end
end
function plutostate_to_julia(statefile::AbstractString, juliafile::AbstractString)
contents = open(f->read(f), statefile)
state = Pluto.unpack(contents)
plutostate_to_julia(state, juliafile)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment