thscharler / spreadsheet-ods

Apache License 2.0
29 stars 6 forks source link

req: Basic support for .fods files #46

Closed cornmonger closed 11 months ago

cornmonger commented 11 months ago

Would it be possible to add support for flat ODS files that are not zipped?

When using ODS files as assets in Git projects, it can be useful to save them in their unzipped format so that Git can properly diff the files and track changes. Even very basic support, without regard to complex manifests, would be highly useful here.

thscharler commented 11 months ago

I have not looked very deep into this topic, so I'm not sure how much of the parsing/writing logic could be reused.

thscharler commented 11 months ago

Hm, it seems doable. Would only need new entry functions and a new layer to put it all in one file.

It will be trickier to get the same XML format as LibreOffice writes, in order to get usefull diffs. And I don't know about other writers at all. So depending on your workflow you might get a lot of garbage in your diffs.

cornmonger commented 11 months ago

That's good to hear!

The two workflows that I'm working with either use LibreOffice to write and this crate to read or vice versa. In those cases, it wouldn't matter if output didn't match LibreOffice line-for-line. I think that even if I had a workflow that went back and forth with writing, extra diffs would still be an improvement. Currently, I have to use a bash script that uses LibreOffice to --convert-to the appropriate format.

thscharler commented 11 months ago

Well then I will ignore the formatting for now.

At the moment I'm grabbing random samples from the internet to do some stress testing. But afterwards I'll look into this one.

cornmonger commented 11 months ago

Thank you!

lmk If you need an extra hand with anything.

thscharler commented 11 months ago

I put this on the "fods" branch.

There are now read/write_fods() functions for this.

If you would give it at try.

cornmonger commented 11 months ago

I've tried out the new read_fods() and write_fods() functions in some of the workflows this morning and they're both working great so far. Thank you again!

thscharler commented 11 months ago

good. I will publish a new version sometime this week including this.