== Using loom === Prepare a safe first project Prerequisites: Nix, Git, and a checkout of this repository. There is no promised prebuilt download. From the checkout, build the package once and remember its executable before changing directories: ```bash nix build export LOOM="$(pwd)/result/bin/loom" lesson="$(mktemp -d)" mkdir "$lesson/src" cd "$lesson" ``` The fresh temporary directory keeps this lesson away from existing work. Create `loom.edn` with this *lesson configuration*, not the repository's real configuration: ```edn {:watch ["^src/.+\\.typ$"] :source-roots ["src"] :annotation :naked} ``` Create `src/hello.typ` containing the following text. The outer four-backtick fence in this manual quotes a sample document; it is not a live target. ````text = A first literate file The file is assembled from one named greeting. ```text #| file: out/hello.txt <> ``` ```text #| id: lesson-greeting Hello from Loom. ``` ```` === Generate, change, and compose Run the executable remembered above: ```bash "$LOOM" . ``` The progress line begins `Writing` and names `out/hello.txt`; its entire contents are `Hello from Loom.` followed by a newline. Change the greeting to your own sentence and run the same command again. Inspect the output in your editor. Run once more without editing: progress begins `Unchanged`, and the output's modification time and permissions are retained. Now add a second whole-line `<>` to the *sample root* above. Regeneration writes the greeting twice. Indent that second inclusion by two spaces: the second generated greeting gains two spaces. Finally append another sample block with the same `id: lesson-greeting`; both inclusions now expand both parts in sorted source-file order and within-file order. This demonstrates composition, not a relationship between the ID and a filename. When ready to inspect the mechanism, follow `<>`, then `<>`. Unknown or cyclic inclusions fail rather than silently writing incomplete text. Keep this lesson's outputs separate from the checkout's generated files.