A few weeks ago I added preliminary support for Typst to knitr. The way it works is simple: if your file has the extension .Rtyp, knitr will recognize it as a Typst document, knit it, and produce a .typ output file. The chunk syntax follows the same Markdown-style fenced code block convention: to end it, with inline R expressions written as {r}</code> to start a chunk and <code>. A minimal example (r exprhello.Rtyp):
<c …