Project files are not accessible from within package #3
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: HEL/rivet-typst#3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As of Typst 0.12, a package cannot access project files (e.g. with
read
,yaml
, etc.) unless it is included in the project itself.The manual should warn the user of this behavior in the documentation for
schema.load
The user should still be able to pass a path, which is useful in the (rare) case described above
The
schema.load
function could be adapted to allow passing the file content (viaread
) and the format (i.e.yaml
,json
, etc.)Stumbled into this while trying to render an example. How do I specify the file to render?
The current workaround is to read the file into a raw block and passing that to
schema.load
:This is really not ideal an I will probably integrate it directly into
schema.load
, except if a mechanism to read files outside of the package is added to TypstAnother solution (even less practical) is to include the package in your project
EDIT: You can actually also directly call the
yaml
orjson
functions and pass the result: