Transforming a Pluto notebook into a Julia package

I write most of my packages in Pluto! I don’t use a tool to convert from Pluto to something else, but the Pluto files are used directly as source code! This is a (secret) design goal of Pluto, and we have features like https://github.com/fonsp/Pluto.jl/pull/2018 to make this easier.


You can use Pluto notebooks as parts of an existing codebase, like in:

This is really useful if you have a fairly isolated piece of functionality. Pluto makes it really easy and fast to develop, document and test (with PlutoTest.jl (reactive tests with time machine)) at once.

(Large notebooks, with lots and lots of cells, are super useful for this! If you want to work on multiple parts at once, you can just open the same notebook in two windows side-by-side.)

You can also use Pluto to write all code of a package, including package tests (with CI) and documentation (CI & GitHub Pages). Examples:


The real expert in this area is @disberd, he works on packages composed of multiple Pluto notebooks with lots of cool macros and tricks to optimise his workflow.

This process definitely has some rough edges (exciting to see if Nbdev.jl can help here!) but I would totally recommend people to experience this for themselves!

11 Likes