-
Notifications
You must be signed in to change notification settings - Fork 31
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
Take pptxgenjs JSON (prop?) as alternative to presentation child #699
Comments
What's the use case for this? I think some kind of escape hatch to be able to use pptxgenjs directly could be good, but replacing Presentation with a json sounds like quite a big change |
If we are programatically generating or modifying this pptxjs json server side, then we have to ship the json to the FE then translate this into jsx 'by hand' in order to display it. For example, imagine I'm storing a bunch of template json in a database; the user selects which 'template' slides they want in what order, then we fill out some variables and now wish to display it. We may also need to generate the output pptxs on the server side, so we can't just write all our pptx templates in jsx. |
Tbh it feels like something that doesn't belong to this core library: the JSON format brings its own implicit versioning and acts as a completely complimentary feature. I'd say translating the JSON into JSX by hand is actually the right approach here. As far as I know, pptxgenjs doesn't offer any kind of JSON serialization features either, so it'd have to be implemented separately for it anyway. I'd suggest creating your own library that can handle conversions from JSON to react-pptx JSX (and I suppose raw pptxgenjs calls as well for serverside usage?). If you make it public, I'd be happy to link to it from the README as well |
Is there a way to do this already, or would you accept a PR?
The text was updated successfully, but these errors were encountered: