A minimal in-memory ZIP reader and writer.
A .docx file is an OPC package, i.e. a ZIP archive, and rendering a
template means reading every entry, rewriting some of them and writing the
archive back out. Entry order is preserved on the way through because Word
expects [Content_Types].xml to come first.
Summary
Functions
Reads every file entry of archive, in central directory order.
Reads path from disk and returns its entries.
Builds an archive from entries, a list of {name, content} pairs in the
order they should be stored.
Writes an archive built from entries to path.
Types
Functions
Reads every file entry of archive, in central directory order.
Directory entries are skipped; only files are returned.
Reads path from disk and returns its entries.
Builds an archive from entries, a list of {name, content} pairs in the
order they should be stored.
Intermediate directory entries are created automatically, which keeps Word happy for packages that reference files across folders.
Writes an archive built from entries to path.