-
-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending zip output with more sub-files #2938
Comments
Hey Prefer if it was added the same way as the rest of the other .xml files are added, so we aren't exposing any internals |
Understood. In that case how about adding an additional argument to the public static async toBase64String(
file: File,
prettify?: boolean | (typeof PrettifyType)[keyof typeof PrettifyType],
overrides?: IXmlifyedFile[],
): Promise<string> {
const zip = this.compiler.compile(file, convertPrettifyType(prettify), overrides);
/* ... */
} And after the statically defined subfiles, for (const subFile in overrides) {
zip.file(subFile.path, subFile.data);
} Would you be open to that or do you have another approach in mind? |
Yeah that could work. It adds some flexibility for certain use cases. Go for it. If you can make a PR, that would be great |
@adamSherwoodGenieAI I've been interested in commentsExtended too in order to use the more modern style of comments in Word. What are you including in the file in order to achieve compatibility? |
Hi @dolanmiu Thanks for this great library.
I'm just running into an issue with trying to add a
commentsExtended.xml
subfile to the exported zip file (for MS Word compatibility).From what I can tell, the simplest way to make this possible would be to publicly expose the
Compiler
class, which is not currently part of the public api. Alternatively thecompiler
field on thePacker
class could be made public.In either case, it would enable user code to call
Compiler.compile
directly, get the returnedJSZip
, ad additional files to theJSZip
, and finally generate the zip.If you're open to the idea, I'm happy to open a PR to make the changes. Let me know what you think
The text was updated successfully, but these errors were encountered: