Hi there.
With the new version, the reference docs indeed got a hell of a lot better, but tutorials are technically (but not generally) pretty bad, IMO. See Refactor tutorials by Andrew15-5 · Pull Request #6417 · typst/typst · GitHub.
With Vim keymaps it’s as easy as moving cursor to opening square bracket, and hitting %. Although without contextual clues, when there is an unpaired bracket somewhere in the text, it will break. Which happens rather frequently for big files with parentheses, depending on the content.
It sounds very generic, but Create a dedicated section on dangers of using square brackets carelessly (multi-line) · Issue #6844 · typst/typst · GitHub is related to significance of whitespaces/newlines in square brackets.
This is kinda what I have in my methodological guidelines project structure: a template function, then prefix() with a bunch of info that can be changed, then included “main” file, then postfix() with a different set of data that fills the gaps in the stuff that goes at the end of each document. This makes it easy to see all the core info that is included at the front and back. The main content goes completely separately, making use of “separation of concerns”.
There are some related packages: its-scripted – Typst Universe.
See Which show rule takes precedence?.
My document is over 100 pages and it’s fine. But depending on use cases, it can be annoying to make it work like you want, often involving workarounds and hacks.