Skip to content

Promote margin to a type - #3811

Closed
Leedehai wants to merge 6 commits into
typst:mainfrom
Leedehai:margin_type
Closed

Leedehai wants to merge 6 commits into
typst:mainfrom
Leedehai:margin_type

Conversation

@Leedehai

@Leedehai Leedehai commented Mar 28, 2024 •

Copy link
Copy Markdown
Contributor

Resolves #3636.

There are 36 testing *.typ files that set the margin parameter for pages, and all of them are passing.

@laurmaedje

Copy link
Copy Markdown
Member

As discussed on Discord, margin being a type isn't necessarily necessary to solve the core issue in #3636, which revolves around (1) auto (not solved here, can't be resolved without context) and (2) non-uniform structure (solved here, but could also be solved just by emitting a normalized dict in IntoValue).

The remaining argument in favor of a type is that user code can also use it to normalize (like with strokes) and not just get rules. However, margin seems a bit niche for that and it's also problematic because of the auto cases (which would need context). A sides type would be a bit more generally useful to be able to normalize a user-provided sides dictionary (like stroke). However, I think we need to discuss all of this more on Discord before moving to an implementation.

@laurmaedje laurmaedje closed this Apr 1, 2024
@Leedehai
Leedehai deleted the margin_type branch April 3, 2024 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote margin to a type

2 participants