fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.92k stars 284 forks source link

File I/O #9

Closed fonsp closed 4 years ago

fonsp commented 4 years ago

One of the reasons to write a notebook system from scratch is to change the default file format. Our wishes are:

malyvsen commented 4 years ago

My suggestion for saving pure Julia files: Before each cell there would be a comment with its UUID, and at the beginning/end of the file, together with a "made with Pluto.jl" notice, we'd include the UUIDs in notebook order, each in its own line. This is Git merge-friendly: if one person added a cell and another reordered some cells, they can still do an automatic merge

fonsp commented 4 years ago

We now have file I/O, but cells are not yet saved in execution order. For this, we first need to implement "run all" functionality. (#12)

fonsp commented 4 years ago

Should Pluto have a built-in file manager? My pros and cons: Pros:

Cons:

A compromise might be: You can open notebooks from within Pluto, with UI similar to VS Code.

malyvsen commented 4 years ago

I think a compromise is best - just launch the default file explorer to "save as"/load notebooks, with "save" ovewriting the current file. New notebooks could start up a new instance of Pluto if that's possible?

fonsp commented 4 years ago

Oh true! We can use the browser implementation for opening and saving :)

malyvsen commented 4 years ago

Perhaps serve_notebook could start up a container of sorts, optionally running in parallel to the main process? I think this would make for elegant management of multiple notebooks

fonsp commented 4 years ago

I think that different notebooks should be able to use the same port (so that you only need to open one port for remote access), so starting a new Pluto instance with a new HTTP server doesn't work - the HTTP server needs to handle multiple notebooks.

We could use the Notebook struct as this container, containing a reference to its modulemanager workspace and update channel.