PragTob / wingtips

A nice little presentation written in shoes
MIT License
12 stars 1 forks source link

Simpler way to define slides #10

Closed jasonrclark closed 10 years ago

jasonrclark commented 10 years ago

Addresses #6, just for fun.

Now you can define things right in config.rb like this:

slide do
  centered_huge_text 'Welcome to Wingtips!'
end

You can also use the dsl in slides/*.rb files, although you'll have to give them a name to reference them later via slides in config, like so:

# slides/title.rb
slide "Title" do
  centered_huge_text 'Easy content, hurray!'
end

#config.rb
slides Title

Zing! :rocket:

PragTob commented 10 years ago

Thanks for these changes, they look good - the usage of instance_eval there impressed me :)

jasonrclark commented 10 years ago

Good catches both, I think we're set here. instance_eval FTW! :smirk:

PragTob commented 10 years ago

Hi Jason,

the slide and initialize method were getting a bit long for my taste :) So with the first I extracted the two parts of the method to helper methods. With the second I extracted the loading of named slides and the associated "switch" - let me know what you think, I feel unsure about the name publish_slide_classes for instance :)

Thanks! Tobi

jasonrclark commented 10 years ago

That all looks reasonable to me. I agree that publish_slide_classes isn't ideal, but I don't have a better option so I'm good to roll with it.

You feel like this is ready for a merge? I've got a smattering of other stuff I've tweaked while working on my presentation that I'll PR in smaller chunks once this is landed.

PragTob commented 10 years ago

Sure, just wanted to get your feedback on my changes first :-)

Should have made that clearer, you could have hit the merge button =)