fonsp / Pluto.jl

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

Idea for richer notebook format #421

Open j-fu opened 3 years ago

j-fu commented 3 years ago

Hi, just a thought here for a possible modificatioon of the notebook format -- in case you are considering to extend the current format with more stored information:

I can imagine to use a special comment prefix and some standard way to store richer config information - Julia or (preferably) toml which you can parse to dicts using TOML.jl E.g. like this:

#═╡ [PlutoNotebook]
#═╡ format_version = "2.0"
#═╡ pluto_version  = "1.20"

#═╡ [PlutoCell]
#═╡ uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
#═╡ hidden = false
#═╡ show_output=true
#═╡ results_on_top=false
hack hack hack

#═╡ [CellOrder]
#═╡ order = [ 
#═╡       "uuid1",
#═╡       "uuid2"
#═╡    ]

(not sure if the Julia toml parser supports arrays).

This would give you the possibility to add richer meta information to the notebook in an extendable way.

Edit: this could be consistent also with some of the ideas in e.g. #142 .:

#═╡ [PlutoProject] 
#═╡   project.toml stuff here
#═╡

Edit: I think an API for reading and writing notebooks could go into an extra package, thus allowing tools like Literate to write notebooks through this API and encourage the development of a large tooling ecosystem.

fonsp commented 3 years ago

Thanks!

311

(I'll point out that you can use ; as the last character of a cell to toggle showing output.)

fonsp commented 3 years ago

I've put this on the notion page: https://www.notion.so/Flexible-notebook-format-61749c09aa1b450fa79f025d725bef4c

j-fu commented 3 years ago

On Mon, 14 Sep 2020 22:56:11 +0200, Fons van der Plas wrote:

(I'll point out that you can use ; as the last character of a cell to toggle showing output.)

... I had in mind the @with_output stuff, also with regard to https://julialang.zulipchat.com/#narrow/stream/243342-pluto.2Ejl/topic/print.20inside.20in.20the.20notebook.3F/near/209725305

Best regards Jürgen

-- Jürgen Fuhrmann Numerical Mathematics and Scientific Computing Weierstrass Institute for Applied Analysis and Stochastics Mohrenstr.39 10117 Berlin phone:+49 30 20372560 fax:+49 30 20372317 http://www.wias-berlin.de/~fuhrmann juergen.fuhrmann@wias-berlin.de

lungben commented 2 years ago

For cell metadata, this is implemented in #1895