gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
2.96k stars 641 forks source link

[FEATURE] User-specifiable transform function to modify the slide XML before it's written #1282

Open samdoeswork opened 1 year ago

samdoeswork commented 1 year ago

Issue Category

Desired Behavior

It would provide a lot of flexibility if we could specify a transformer-function which runs on the output of each slide.

E.g. an option called transformSlideXML with the signature (inputSlideXML) => string; So if specified then makeXMLSlide would run the output through this function before returning.

This would give users the option to implement anything you do not support by piping the XML of each slide through this function.

(In my case I would really like to have control over autoplay & looping of videos. I realize this is too much of an ask as a feature. So a transformer function would let me find/replace to add this myself in an elegant way.)

This would essentially let people write mini plugins to patch new features in if they do not have the confidence/familiarity to submit them as PRs. (E.g. in my case I can identify the XML that would need to be added and where to add it but I don't have the confidence to turn this into a PR).

samdoeswork commented 1 year ago

In fact I could probably make a PR for this if you like the idea.

Really like this library - thank you for what you're doing.