The idea is that I want to share and track documents over git
I thought about using Text Documents (markdown docs that look like docx,odt in functionality) that can be edited with any text editor (not binary). Where to find something like this?
any better solution?
What is an ODT file? ODT files are type of documents created with word processing applications that are based on OpenDocument Text File format. These are created with word processor applications such as free OpenOffice Writer and can hold content such as text, images, objects and styles.
There are two tools which can be used to let git diff odt files: odt2txt
and oodiff
.
See this resource for details on how to set this up (also includes information on Mercurial and SVN.)
Snippet of above instructions (for git >= 1.6.1):
First, install odt2txt
, and configure git to allow it to run it, by adding this to ~/.gitconfig
:
[diff "odf"]
textconv=odt2txt
Now, for each project, you just need to ask git to use this driver in .gitattributes
or $GIT_DIR/info/attributes
, like this:
*.ods diff=odf
*.odt diff=odf
*.odp diff=odf
LaTeX is perfect for combining it for git. But if you cannot afford yourself the time to "translate" all to LaTeX, I think a great option that fits your needs is using LibreOffice and saving files in .fodt format (Open Document Text - Flat XML). These files are uncompressed XML, so you can use all the power of git as you can see addition and changes to the document line per line.
This will make merging an easy task. Even binaries (e.g. when you include an image) will be embedded in the document and shown as text. Of course you cannot manipulate them from there but you can remove the whole tag or edit attributes with the simplest text editor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With