{"id":24258326,"url":"https://github.com/sillyfreak/typst-prequery","last_synced_at":"2025-03-04T20:29:39.218Z","repository":{"id":247958574,"uuid":"812650123","full_name":"SillyFreak/typst-prequery","owner":"SillyFreak","description":"Extract metadata from typst documents for preprocessing","archived":false,"fork":false,"pushed_at":"2025-02-20T15:18:30.000Z","size":10646,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T02:15:59.821Z","etag":null,"topics":["typst","typst-package"],"latest_commit_sha":null,"homepage":"https://typst.app/universe/package/prequery","language":"Typst","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SillyFreak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-09T13:52:06.000Z","updated_at":"2025-02-20T15:18:33.000Z","dependencies_parsed_at":"2024-10-21T22:28:38.841Z","dependency_job_id":null,"html_url":"https://github.com/SillyFreak/typst-prequery","commit_stats":null,"previous_names":["sillyfreak/typst-prequery"],"tags_count":1,"template":false,"template_full_name":"SillyFreak/typst-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-prequery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-prequery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-prequery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SillyFreak%2Ftypst-prequery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SillyFreak","download_url":"https://codeload.github.com/SillyFreak/typst-prequery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241917157,"owners_count":20042051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["typst","typst-package"],"created_at":"2025-01-15T05:37:13.417Z","updated_at":"2025-03-04T20:29:39.192Z","avatar_url":"https://github.com/SillyFreak.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prequery\n\nThis package helps extracting metadata for preprocessing from a typst document, for example image URLs for download from the web. Typst compilations are sandboxed: it is not possible for Typst packages, or even just a Typst document itself, to access the \"ouside world\". This sandboxing of Typst has good reasons. Yet, it is often convenient to trade a bit of security for convenience by weakening it. Prequery helps with that by providing some simple scaffolding for supporting preprocessing of documents.\n\n## Getting Started\n\nHere's an example for referencing images from the internet:\n\n```typ\n#import \"@preview/prequery:0.1.0\"\n\n// toggle this comment or pass `--input prequery-fallback=true` to enable fallback\n// #prequery.fallback.update(true)\n\n#prequery.image(\n  \"https://en.wikipedia.org/static/images/icons/wikipedia.png\",\n  \"assets/wikipedia.png\")\n```\n\nUsing `typst query`, the image URL(s) are extracted from the document:\n\n```sh\ntypst query --input prequery-fallback=true --field value \\\n    main.typ '\u003cweb-resource\u003e'\n```\n\nThis will output the following piece of JSON:\n\n```json\n[{\"url\": \"https://en.wikipedia.org/static/images/icons/wikipedia.png\", \"path\": \"assets/wikipedia.png\"}]\n```\n\nWhich can then be used to download all images to the expected locations.\n\n## Usage\n\nSee the [manual](docs/manual.pdf) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyfreak%2Ftypst-prequery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsillyfreak%2Ftypst-prequery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsillyfreak%2Ftypst-prequery/lists"}