5 ms·
>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
by 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)