Draft
Conversation
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update is another rewrite that brings full functionality of zint to Rust. Previously we stubbed out most of zint outputs, all of them are handled correctly now. Primitives have been added to work with geometry generated by zint from Rust and this is passed to Typst instead of raw SVG to allow a lot more customization.
Additionally, options are strongly typed now based on symbology to simplify usage - previously you had to look at zint documentation to figure out which options and values are valid for each symbology, stronger Options types mean you can tell instantly what inputs are correct just by looking at Rust invariants. There's a
GenericOptionswhich directly maps to zintsymbolfields and allows the library to be used as it was before - this means that if we miss something in strongly typed options, users will still be able to achieve the same functionality as before.Zint docs are also copied into rustdoc which allows us to use macros to have the Manual mirror official documentation instead of simply linking to it. This will make the Manual much easier to use because each option will be fully documented.
I added support for segment encoding and ECI in the rust code, which allows the users to encode symbols with multiple ECI segments that support it.
Finally, this update brings the bindings pretty close to being usable outside of WASM, so that we can publish them on crates.io later and possibly bring in more contributors/maintainers. This part is not the main focus of this PR and might require some minor later changes - but those will be minor, most of the
build.rsis updated for the sys crate and custom serde deserialization will be removed.As part of this update, zint is updated to contain the newly added symbologies (closes #22).
TODO
zint-wasm-rs) should be stricter, typst crate (zint-typst-plugin) will have serde logic that's almost the same as before and remaps options to the same fields.