cabal build all
cabal testGolden tests live under test/golden/. When a change intentionally alters
rendered output, review the diff and then re-bless:
GRANITE_BLESS_GOLDEN=1 cabal testThe tutorial is a scripths notebook.
The source of truth is docs/base/tutorial.md; the rendered companion
docs/tutorial.md is generated — do not edit it by hand.
Workflow:
-
Edit
docs/base/tutorial.md. It is prose plus runnablehaskellcells. Each cell declares its dependencies inline (-- cabal: build-depends: ...), builds a chart, and ends with a statement that prints it as SVG, e.g.Text.IO.putStrLn (renderChartSvg chart). Cells are GHCi statements (top-level bindings and a trailing expression), not amodule Main/mainprogram. -
Run scripths to generate the final tutorial — from inside the repo, so cells build against the local working tree (scripths auto-detects the enclosing
granitepackage):scripths -o docs/tutorial.md docs/base/tutorial.md
scripths evaluates each cell in order and inlines its captured output (the SVG) beneath the fence as a block quote.
-
Commit both
docs/base/tutorial.mdand the regenerateddocs/tutorial.md.
scripths is a separate CLI; install it and ensure it is on your
PATH. (This replaces the oldercabal run granite-tutorialflow.)