-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add named schemas for missing built in types #18
Add named schemas for missing built in types #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense overall, I've attached a list of types that I compiled when I scraped the Typst docs manually.
…for-missing-built-in-types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I think we can add most of them as they are.
But I think we should (in another PR) add some coercions for some of those types, like stroke
.
Some of them may also need default post-transformations.
#let relative = base-type.with( | ||
name: "relative", | ||
types: (relative, ratio, length), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little concerned about this one, length
and ratio
will not have the same methods as relative
for example, z.parse
would return whatever type is passed without converting it to a relative.
This can be problematic, as shown here.
Should we be less permissive about the types or add a default post-transformation?
Added the following missing common types:
Prior to merge, ensure that: