Close#1830 and close#2063
The hook script feature is available since `tinymist` v0.14.2.
Hook Scripts allow you to hook and customize certain behaviors of tinymist by providing code snippets that will be executed at specific events.
The hook scripts are run as typst scripts with some predefined variables. Since typst is sandboxed, the hook scripts cannot access system directly. However, you can still bind lsp commands to perform complex operations.
See https://myriad-dreamin.github.io/tinymist/feature/script-hook.html.
- [x] run a demo
- [x] finish tests
- [x] add docs