5 ms·
I was actually surprised : last time I used Git Bash on Windows it did work quite well with .docx files. Then I switched jobs to avoid touching .docx files ...
by yarky 5y ago
I was actually surprised : last time I used Git Bash on Windows it did work quite well with .docx files.
Then I switched jobs to avoid touching .docx files ...
The best alternative I've found to generate .docx output is R markdown, which uses pandoc under the hood and let's you program the whole document the way LaTeX would.
- IceWreck 5y agoIsnt docx binary ? So git is storing a new version of the file every commit. That way too much storage space youre wasting.
- BerislavLopac 5y agoThat's exactly what the actual git does too.
- testermelon 5y agoI've heard somewhere that docx is actually gzipped xml. But I never really confirmed that myself. But it's binary once gzipped, so your point still stands.
- simion314 5y ago>I've heard somewhere that docx is actually gzipped xml. But I never really confirmed that myself. docx and epub are zip files, you can rename them with a .zip at the end and open to see what is inside. It might not be as simple to zip them back, at least for epub is very important to zip the files in a certain order but I forgot the details, but is easy to do from command line.
- bellweather49 5y agoOr use Vim; it has built in support for zip files, so you can just type something like `vim my_file.docx` and it will open the files in netrw (the built in file explorer). Move to the file you want and hit enter. "word/document.xml" has the main document contents in it. The xml will probably need to be run through a formatter to be readable. You can type `:%!xmllint --format -` if you have xmllint installed. Now prepare to spend several hours trying to make sense of the xml. :-p
- simion314 5y agoVim is not for me, I unzip the epub/docx and then open the xml/html files in Kate, I had to do this to examine what is saved or how it saved or if my custom epub exported worked correctly. For epub I think you need to make sure the metadata file is the first one in the archive for it to work(so not sure if editing stuff directly in vim will preserve the order)
- JonathonW 5y agoDocx (and pptx, and xlsx) is a zipped (not gzipped) composite of several XML files plus any other attached resources. It extracts out to a whole folder structure. Definitely binary once compressed, though, and even when extracted not an easy format to parse. It might be XML, but it’s still representing the full complexity of an MS Office document.
- deleted 5y ago[deleted]
- zouhair 5y agoJuzipped. Just take a docx file and append .zip to it and open it.
- copperx 5y agoDoesn't git do binary deltas?
- tashbarg 5y agoGit stores a new file anyways. It’s only for packs, that delta compression is applied. And delta compression handles binary files.
- deleted 5y ago[deleted]
- TuringTest 5y ago> The best alternative I've found to generate .docx output is R markdown I do the same with markdown in Zettlr, which has a nice inline-preview format and can be used by my non-tech partners. The generated .docx has a limited range of styles, but we see that as an advantage.
- greyhair 5y agoPre LaTeX (I am old...) I wrote a huge command definition document for an embedded telecom product in nroff/troff. The whole thing was text files, with all the common parameters documented once, and the whole thing was assembled using a Makefile. So a typical page would be the command name, a descriptive paragraph, an include list of the parameters it used, and an include list of the possible return errors. Very little writing for a new command that mostly used existing parameters and errors. And all tracked under CVS with a management/tracking layer on top. # make command_doc and the pile of text became a lovely 250 page postcript ready for the laser printer.
- newbamboo 5y agoPowershell can generate and manipulate word docs, as another alternative to keeping content in a markdown file.