Downloads files from the web. If a file required by the document exists already, it is not re-downloaded by default. This preprocessor can be used in combination with the Prequery package's image()
image()
function.
# the query getting metadata from the document
# see https://typst.app/docs/reference/introspection/query/#command-line-queries
query.selector = "<web-resource>"
# query.one = false # this can not be changed for web-resource jobs
# force re-downloading existing files
# can be set to `true` or a file name to keep a file with all known resources
# the query getting metadata from the document
# see https://typst.app/docs/reference/introspection/query/#command-line-queries
query.selector = "<web-resource>"
# query.one = false # this can not be changed for web-resource jobs
# force re-downloading existing files
# can be set to `true` or a file name to keep a file with all known resources
# the query getting metadata from the document
# see https://typst.app/docs/reference/introspection/query/#command-line-queries
query.selector = "<web-resource>"
# query.one = false # this can not be changed for web-resource jobs
# force re-downloading existing files
# can be set to `true` or a file name to keep a file with all known resources
# the query getting metadata from the document
# see https://typst.app/docs/reference/introspection/query/#command-line-queries
query.selector = "<web-resource>"
# query.one = false # this can not be changed for web-resource jobs
# force re-downloading existing files
# can be set to `true` or a file name to keep a file with all known resources
The web-resource
web-resource
preprocessor can optionally keep an index file. This means it will know what local files come from resources and can do a better job keeping local files and resources specified in the document in sync. If index = true
index = true
is configured, the default index file name web-resource-index.toml
web-resource-index.toml
is used.
When using an index, web-resource
web-resource
keeps track of all file names and and URLs in the document. If a file is present, but the associated URL changes, the resource will be re-downloaded; this is different from the default behavior, where an existing file would never be re-downloaded (since the preprocessor also doesn't know what URL the file previously came from).