I’m trying to set up some workflow tooling, trying to replicate the jump_from_cursor logic from Typst’s web IDE where I display only the rendered typst page where my (personal) IDE cursor position is.
Two approaches I’ve tried:
- Tried looking for some arguments to pass my IDE cursor position either into
typst.exe compileto only render that page, or intotypst.exe queryto extract the page number, so then I could pass it totypst.exe compile.
Unfortunately doesn’t look like anything exists.
- Inject some Typst code (such as a label or some metadata) at/or near my IDE cursor beforehand, then use
typst.exe queryto extract out it’s page location to use withtypst.exe compile.
While this approach works, it’s hacky and very fragile, since it’s pretty easy to create uncompile-able code without being clever about where you inject this code in.
Eg. I’ve tried injecting #context[ #here().page() <cur>] at the closest empty line to my cursor, but this breaks if that’s within a code block.
Is there a non-hacky way to accomplish what I want to do?