Repository navigation
Add targets - #1904
Add targets#1904SekoiaTree wants to merge 4 commits into
Conversation
|
In my opinion, it should not be PNG but |
|
Should I change SVG to |
|
I ended up changing |
|
To be honest, I'm personally somewhat against having such a feature in Typst, at least at the current stage. Because by introducing the possibility to add target-specific code, we can no longer expect all of the output formats to look the same, which in my opinion is an unfortunate side-effect, especially for the web app, since then the outputted PDF might look differently than what was shown in the preview. I'm aware that since HTML support is planned, at some point there might have to be a way to introduce target-specific code (although I have no clue how this could be done in a nice way), but at least for now, while we still have the same frame-based representation for each output format (PNG, PDF, SVG), I would personally steer away from allowing users to specify target-specific code, at least until more details about how the distinction between layouted and pageless formats will be dealt with have been hashed out. Just my two cents though. 🙂 |
|
We could perhaps delay this change to when HTML export is added, and maybe have a way to differentiate HTML export from the rest. Regarding differentiating PDF / PNG / SVG, that could be postponed until we have a proper discussion on whether that's worth it or not. |
|
I originally thought that there was no harm in supporting this as is already, but it is true that there's still a discussion to be had how fine-grained targets should be. It could be per-format with simple accessors for groups of related formats or it could be that we only expose the group information. We could even store the format internally, but not expose it and that way still have overlapping groups of formats (like is-layouted, is-x, is-y). |
|
I'll close this for now as things will still take a bit. We can see again then. I might also just add this alongside other stuff when I'm working on the relevant parts. |
This PR adds support for targets, which allow a document to know what it's being compiled into.
This is part of the basics that will eventually allow HTML compilation.
Currently missing: