senny / sablon

Ruby Document Template Processor based on docx templates and Mail Merge fields.
MIT License
443 stars 126 forks source link

support open document format (ODT) #119

Open blshkv opened 5 years ago

blshkv commented 5 years ago

Hi, I was wondering if you plan to support libreoffice as well? I use ODT by default and it would be really useful if the tool could support it natively without any manual conversion. Thank you for the great project!

stadelmanma commented 5 years ago

Hi @blshkv, Supporting ODT format document would be a nice extension although to be honest even though I am a Linux user my experience with OpenOffice as a whole is quite lacking. The other concern would be how much ODT and DOCX vary in regards to XML format.

If this is something you'd like to work on I would be happy to provide input along the way and we can see if it's something that will work well in the gem. The first step would be writing a suitable content parser to extract the merge fields and then the logic to fill in those fields.

Basic insertion would probably be relatively easy but the more advanced content types such as HTML may be complex if the XML that needs to be generated is significantly different. Since the current AST implementation does lend itself well to multiple output syntaxes.

blshkv commented 5 years ago

Honestly, I'm not ready to write the library but I'm happy to provide some fixes, feedback, testing. For the last 12 years I have tried few: ruport, documatic, odf-report, serenity may be others. I'm ready to go with any active project. We can probably copy a code from other projects (ruport?) if it could help.

stadelmanma commented 5 years ago

Unfortunately, I don't have the time right now to investigate what might be required to extend sablon to work on ODT files but I will leave the issue open in case others would have an interest/need.