-
Notifications
You must be signed in to change notification settings - Fork 648
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
Master Slide & Layout Slides #161
Conversation
…ayout files can be passed to the presentation. Otherwise, works as originally.
…same definition as original "masters".
…amically added to master slide. Shape support added.
…f duplicated code /slide vs layout slide)
…errenced relations are added (layouts, masters, themes) + Master slide is generated by JSON
Chatty object creating changes to a single assignment. $.each -> array.forEach Refactoring nomenclature Conditions on gObjPptx.masterSlide removed (always defined, but empty by default)
When no layout specified, empty used.
66af022
to
65a0cca
Compare
Allowing the new master-layout approach has changed. The method |
Whoa, i'm already doing integration work on this. Please stop changing the PR. |
I'm sorry, I did not noticed it's in progress. This was just a little change, however if any other will appear, I'll create another PR conditioned by this one. |
Thanks @kajda90 ! Great work on the creation of actual Slide Master Layouts. This is a major improvement to the generated presentations and is easier to use than the old method. Note that i made a few changes that will impact your code when you start using the current version... Basically, i removed the legacy Master Slides ( It's a change for you, but hopefully something easy and concise for the general user population. The README and examples have been updated, but here's a summary: pptx.defineSlideMaster({
title: 'MASTER_SLIDE',
bkgd: 'FFFFFF',
objects: [
{ 'line': { x: 3.5, y:1.0, w:6.00, line:'0088CC', line_size:5 } },
{ 'rect': { x: 0.0, y:5.3, w:'100%', h:0.75, fill:'F1F1F1' } }
]
});
var slide = pptx.addNewSlide('MASTER_SLIDE'); |
Hi @gitbrent ! There's a use case, consider the following: And you removed the support for creating PptxGenJS instances in Node? (I mean the factory.) |
Hi @kajda90 , Thanks for following up. :-) The current design does only create Master Slide Layouts - and not a parent Slide Master (it's just blank/white). I did that because i wanted to provide a simple interface for new users and have a similar mechanism for current users - creating a thing to put another thing under seems like a lot of work to some users. I plan to add back the ability to create an actual Master Slide, then add these Layouts under it, but probably at 2.0. I'm more keen to take big steps with features like this and not giant leaps. Lastly, the factory and that other item (or two?) that were added came after i branched and you said you'd open another PR, so I did not attempt to integrate them. I'm very interested in the factory though! Please provide a demo showing how to use it - i'm not a nodeJS expert. :-) Thanks again for all the hard work. I really appreciate your contributions. |
Hi @gitbrent , Aha, okay, it's up to you. As for the factory, I can create a demo of course and add missing information to readme. Should I create the factory as a new PR? I guess so. |
Yes, please PR and document the factory. We have a large Node user base, and i know they'd appreciate your contribution. |
Hi @gitbrent,
I've implemented the master slide and slide layout solution I've proposed in the issue #146. It's kinda huge pull request so I'll try to focus on the major changes and important parts in the following list:
API Notes
pptx.useProperMasterLayout
needs to be called before saving presentation – this ensures that user intentionally work with the new approach provided by the feature.Implementation Notes
gObjPptxGenerators
. But still, the slide object (compared to layout or master slide) has extra functions (such asaddTable
) – however, these could be moved togObjPptxGenerators
as well.Formal Notes
In touched functions, I have
$.each(array, function(idx, el) { ... })
byarray.forEach(function(el, idx) { ... })
because I've noticed you were using both but it's not necessary to use jQuery alternative when there's the native one;I'm not sure I've mentioned all I should have so if you come across any unclear parts (whether in my description or in the code), ask me please. In closing, I'd some suggestions: