Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin run when before hook events. #36

Closed
suisho opened this issue Apr 19, 2014 · 4 comments
Closed

plugin run when before hook events. #36

suisho opened this issue Apr 19, 2014 · 4 comments

Comments

@suisho
Copy link

suisho commented Apr 19, 2014

Hello.
I tried to create plugin that modify sections before bespoke start hook event.
But currently cannot that.

Out of necessity, I implement this function as outside plugin. But that so dirty. 馃槶
like this

beforeBespke('article', function(from){
  bespoke.from(from, {
    keys: true,
    touch: true,
  });
})
var beforeBespke = function(from, callback){
  // emulate bespoke from
  var parent = selectorOrElement.nodeType === 1 ? selectorOrElement : document.querySelector(selectorOrElement)
  var slides = [].filter.call(parent.children, function(el) { return el.nodeName !== 'SCRIPT'; })
  var deck = {
    slides : slides
  }

  //  :
  // do something modification to slide.
  // (This is a point want to plugin)
  //  :

  callback(from)
}

Please tell me if you have more good idea

@markdalgleish
Copy link
Member

What is your plugin attempting to do? I've considered this functionality in the past, but I've never personally had a need for this so I've avoided complicating things.

@suisho
Copy link
Author

suisho commented Apr 20, 2014

Sorry, my case is actually rare case, not commonly.

In detail, I need print out PDF and use that on the presentation.
And split bullets page when print out.
(I omit the reason for must use PDF, because complex and shitty..)

For example,

origin

<article>
  <section>
    <ul>
      <li> list 1 </li>
      <li> list 2 </li>
      <li> list 3 </li>
    </ul>
  </section>
</article>

after convert

<article>
  <section>
    <ul>
      <li> list 1 </li>
    </ul>
  </section>
  <section>
    <ul>
      <li> list 1 </li>
      <li> list 2 </li>
    </ul>
  </section>
  <section>
    <ul>
      <li> list 1 </li>
      <li> list 2 </li>
      <li> list 3 </li>
    </ul>
  </section>
</article>

This is sample
http://suisho.github.io/bespoke-printable-bullete/

@markdalgleish
Copy link
Member

I've actually discussed this functionality with a couple of other Bespoke users and it's possible without modifying the slide markup.

Our idea was to use PhantomJS to take a screenshot of every state, calling deck.next() until the presentation finishes. The benefit of this approach is that it would allow all custom themes to be printable without the need for a special print styles.

Sorry, but I'm going to close this issue. I'm open to the idea if a compelling use case comes along, but I'm afraid this isn't it.

@suisho
Copy link
Author

suisho commented Apr 20, 2014

Ok, Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants