Can I configure my document (e.g. draft/release version, color theme) when creating a PDF without modifying the Typst file directly?

For windows, there are two things that need to be different to take in JSON data from the command line (for those who were lost like me).

  1. cmd doesn’t have strong quotation using single quotes, so we have to escape double quotes like this: --input "data={\"some-num\": 1, \"some-bool\": true}"
  2. For typst 0.13.1, it says that json.decode() is deprecated, but not using it and passing the data directly to the json function json(sys.inputs.data) results in this error:
error: failed to load file (The filename, directory name, or volume label syntax is incorrect. (os error 123))
   ┌─ \\?\C:\Users\<redacted>\Desktop\typst\testing\test.typ:11:14
   │
11 │ #let d = json(sys.inputs.data)
   │

So, just using json.decode() works fine.

1 Like