Interactive notebook for March — Livebook-style in the browser.
Notebooks are plain Markdown files (.scrollmd) with fenced March code blocks. Open them in the browser, run cells interactively, and save changes back to disk.
March 0.8.0 or newer. Scroll has no package dependencies: it serves the
notebook with the standard library's HttpServer and WebSocket.
Scroll is a forge tool: installing it adds the scroll.serve command. It's
listed on the forge registry at https://forgepm.org/packages/scroll.
Install directly from the GitHub source:
forge install https://github.com/march-language/scrollOr from a local checkout:
git clone https://github.com/march-language/scroll
forge install ./scrollgit clone https://github.com/march-language/scroll
cd scroll
forge checkforge notebook serve path/to/analysis.scrollmdforge notebook serve finds the project the notebook belongs to (the nearest
forge.toml at or above it) and runs the notebook's cells:
- with that project's
lib/and its dependencies (path, git and registry, resolved asforge buildresolves them) available toimport; - with the March toolchain the project pins in
.march-version, if any; - from the project's root directory, so relative paths in cells resolve against the project wherever you start the server.
A notebook outside any project gets a forge.toml of its own beside it.
--port N picks the port (default 4040) and --no-open skips opening the
browser.
forge scroll.serve FILE also starts the server, but it does not resolve the
notebook's project.
- ▶ Run All runs every code cell in order, reusing the REPL's state.
- Restart & Run All starts a fresh March runtime first, so the outputs reflect the notebook as written rather than earlier runs.
- Run Stale re-runs only the cells your edits affected: the edited cell and the later cells that use a name it defines. A cell that loads data is not re-run unless it changed.
Cells run in the March interpreter. To use the REPL JIT instead, set
MARCH_REPL_INTERP=0 in Env.
Three modules ship with Scroll. Import the ones a notebook uses:
import ScrollTable
import ScrollChart
import ScrollInput
ScrollTable.csv("data/orders.csv")
ScrollTable.json("report.json") -- an array of objects
ScrollTable.json_at("report.json", ["models"]) -- an array inside an object
ScrollTable.json_value(value, "label") -- a JsonValue you already parsed
ScrollTable.rows(["day", "orders"], [["1", "96"], ["2", "102"]])
ScrollTable.data_frame(df)
The table shows each column's inferred type (int, float, bool, date
or text) and how many values are missing (empty, NA, null, NaN, ...).
Click a column to sort it and type in the filter box to narrow the rows.
Large tables page 100 rows at a time and send at most 5,000 rows to the
browser; the type and missing-value summary covers every row.
Open Data… in the toolbar adds a table cell for a file.
ScrollChart.new()
|> ScrollChart.title("Forecast error by lead")
|> ScrollChart.x_label("Lead (hours)")
|> ScrollChart.y_label("MAE (MW)")
|> ScrollChart.line("Weekly naive", hours, naive_mae)
|> ScrollChart.line("Chronos-2 Small", hours, chronos_mae)
|> ScrollChart.band("P10–P90", hours, p10, p90)
|> ScrollChart.show()
Charts fill the notebook's width, give each series a legend entry and a hover
tooltip, and skip NaN values. Marks: line, points, band, bars, and
line_dates/points_dates/band_dates for ISO dates on the x axis.
ScrollChart.to_spec returns the Vega-Lite spec itself.
let model = ScrollInput.select("Model", ["Weekly naive", "Chronos-2 Small"], "Chronos-2 Small")
let horizon = ScrollInput.slider("Horizon (days)", 1, 28, 14)
Each call shows a control and returns its current value. Changing the control
re-runs that cell and the cells that depend on it, and nothing else. Values
are kept per notebook, so they survive a reload and Restart & Run All. Also:
number, text, checkbox. A control's label is its key, so labels must be
unique within a notebook.
··· → Export HTML writes a standalone page with each cell's source and output. Charts are embedded as static SVG and tables as their current view.
A .scrollmd file is standard Markdown. Code cells use fenced March blocks:
# My Notebook
Some prose here.
```march
let x = 6 * 7
```
```march
x
```- Markdown cells — rendered as HTML in the browser
- Code cells — run in sequence; each cell sees bindings from earlier cells
letbindings are silent (no auto-print), just like a REPL assignment- Plain expressions auto-print their value if non-unit
Long-running processes (HTTP servers, background workers) use the march:server fence:
```march:server
HttpServer.start(3000)
```Server cells run as background processes with Start/Stop controls in the UI.
cd /path/to/scroll
# Unit tests
MARCH_LIB_PATH=lib:lib/scroll march test test/test_scroll.march
MARCH_LIB_PATH=lib:lib/scroll march test test/test_scroll_data.march
# Browser-side unit tests (dependency analysis)
node --test test/js/scroll-deps.test.cjs
# End-to-end tests over the notebook WebSocket protocol
python3 test/test_scroll.pyNote: run the unit tests with
march test(the interpreter), as above.
After editing lib/scroll.march, changes are live immediately — no reinstall needed when installed as a path archive (forge install scroll@./).