This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
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.
Hello @juruen,
I have started a refactoring with this pull request by creating 2 separate packages for 2 well defined purposes:
This would help building a solid base around remarkable formats before starting to analyse the new SVG feature (#41).
The package archive is more or less a wrapper around the standard "archive/zip" package and the interface is similar.
I have added the package "rm" into an "encoding" folder as made in the standard library for different formats (e.g. encoding/json). That would allow for instance to create other encoders/decoders for other remarkable files present in the ".zip" (e.g. encoding/pagedata). The code of this package is by the way a lot inspired by what you did in "annotations/rm.go". I have added the "encoding/rm/marshal.go:MarshalBinary" method as TODO so far because did not take the time to implement it.
I have refactored your annotations package to use these 2 new introduced packages. But I did not take time to refactor the "api" package but this would be nice to use them as well. As far as I understand, the "util/zipdoc.go" could disappear if everything is refactored.
I let you have a look and come back to me if you see any problems with this implementation!
Thanks,
Loric