Open Makogan opened 1 year ago
Have a look at this repo: https://github.com/Lakret/gir/blob/master/mazes/src/draw.rs They're using into_iter().fold() to add paths from a Vec of Path into the document.
Yes, indeed the documentation is sparse. The assumption here is that the user is familiar with the format and knows what combines with what and how. The example you gave breaks against the rules (at least, I have not see nesting paths in paths), which are not enforced by the crate.
In any case, the format will probably not be explained here; it does not feel to belong. One could show more examples, but they will not be exhaustive, and one would run into problems still if there is no prior knowledge of the format.
It would be helpful to have a few more small examples. One thing in particular would be how to add multiple objects. Like a square and a circle, both with different stroke styles.
As it stands one might thing that the way to do this would be: