Five-minute quickstart

The shortest path to a running notebook. One input, one derived value, a live slider — nothing else. For the full walkthrough (rendering, layout, building), read Write your first notebook next.


You need Go 1.25 or newer. A notebook is an ordinary Go package, so it lives in a Go module.

mkdir hello && cd hello
go mod init hello
go get -tool github.com/scttfrdmn/go-notebook/cmd/notebook@latest

Create hello.go:

//go:notebook
package hello

// Input value.
//notebook:slider min=0 max=100
func input() (x int) { return 20 }

// Twice the input.
func doubled(x int) (y int) { return x * 2 }

Run it:

go tool notebook run .

A browser opens showing the graph input → doubled, a slider, and a live value. Drag the slider — doubled recomputes.

That is the whole model. The edge exists because input produces a result named x and doubled takes a parameter named x:

A cell’s named result feeds any cell that takes a parameter of the same name and type.

You wrote no wiring, no callback, no reactive framework. The graph is derived from the function signatures by the Go type checker, so it cannot drift from the code.

What just happened

See one run

Your two-cell notebook is deliberately tiny. Here is the next step — the Celsius→Fahrenheit notebook the first-notebook walkthrough builds — compiled to WebAssembly and running right here. Same rule (a result named c feeds the parameter c), one more cell, a rendered gauge. Drag it:

Next