Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Mark Dalgleish
    @markdalgleish
    hey there—love your work!
    two things that need work IMO
    you shouldn't have to say how many slides there are, and bullets should work
    could we solve this if there was an event that fired when the end of the presentation is reached?
    you could just call deck.next() over and over, taking a screenshot each time, until you hit the end?
    you could potentially achieve this today, but it would require that bespoke-pdf is that last plugin used so that it can hook into the 'next' event and be sure that another plugin, like bespoke-bullets, hasn't cancelled the event
    nw-shot would need to support the equivalent of a 'while' loop
    e.g. keep calling eval 'window. BESPOKE_PDF.next()' until 'window.BESPOKE_PDF_IS_DONE' evaluates to true, or something
    Mark Dalgleish
    @markdalgleish
    hope all of that made sense
    David Mark Clements
    @davidmarkclements
    Hey Mark thanks for feedback - so currently bespoke-pdf (unlike bespoke-to-pdf) doesn't need a slide count passed manually - it uses deck.slides.length. I actually did manage to get nw.js to pick up ever a (see nw-app/app.js - I listen to the activated event (maybe I should be listening for next?) to be notified of a slide change). So yah I was thinking a while loop, which could be used to progress through bullets until another activated event is fired - another route is being able to dynamically disable any plugins that have already registered - this would feel safer than a while loop where unforeseen edge cases could cause an infinite loop and essentially freeze generation with no user feedback, but would mean keeping a blacklist of plugins that alter nsd behaviour, and of course having some way to disable registered plugins
    After this is fixed, moving forward - it's been made to slip nicely into a bespoke main.js and work in a gulpfile - so would the best thing be to PR generator bespoke?
    David Mark Clements
    @davidmarkclements
    Oh one other thing - particularly for heavy presentations - eg lots of slides and/or heavy images - there is the moment of chaos before order prevails. Originally I thought the "activated" event coincided with that moment after the FOUC. Currently I'm using a setTimeout which is quite brittle, if someone's presentation is really heavy, OR they have a slow CPU or connection the timeout won't be adequate - the first shot will be garbage. Is there a way to know when bespoke has truly kicked in?
    Mark Dalgleish
    @markdalgleish
    without having tried it, I think listening for the 'next' event is your best bet, as it fires whenever the last slide is requested
    if you look at bespoke-loop, you can see an example of how it determines whether you've called 'next' while on the last slide
    it needs to be the last plugin in the plugins array for this to work
    bespoke-bullets cancels the 'next' event if the current slide has a pending bullet, so the event won't reach the last plugin
    Mark Dalgleish
    @markdalgleish
    the FOUC is currently unavoidable, it's a result of all the bespoke classes being added to the elements, and the subsequent transitions all firing off
    re: infinite loops, I don't think you should worry about that too much—it's the presentation author's responsibility to manage that
    maybe add a feature in future to detect loops, but I wouldn't treat it as a priority
    Mark Dalgleish
    @markdalgleish
    re: FOUC, maybe listen for transitionEnd events? Easier said than done, of course, because there's no transitionStart event, so you'll have to figure out what to listen for
    before this gets included with generator-bespoke, I'd want to be sure that the nw.js is cached so that I don't have to redownload it every time I create a new deck—it doesn't seem to be the case right now, is that right?
    David Mark Clements
    @davidmarkclements
    Yah it gets dl'd each time which is annoying - I guess it could be cached by sticking in a hidden dir in users home folder - it's a little intrusive but it's either that or require a global install for the nw-shot dep which makes for a overly manual install process
    in terms of FOUC - bespoke to PDF disables transitions by injecting a script tag - this makes for cleaner shots. I wonder does that prevent the FOUC - haven't checked - if it doesn't then transitionEnd wouldn't be the answer anyway (since there's no transitions)
    David Mark Clements
    @davidmarkclements
    if there is still a FOUC i could poll for the final class bespoke adds
    Mark Dalgleish
    @markdalgleish
    oh yeah—I forgot about the first FOUC, I was thinking about when you see all the slides transitioning at once
    David Mark Clements
    @davidmarkclements

    Hey Mark,

    So I've been snowed for a while, just had a chance to work some more on this, I've solved the re-downloading problem bespoke-to-pdf uses nw-shot (which was created for bespoke-to-pdf). nw-shot is what triggers the nw.js download, that's now managed by install-nw which I made for this purpose (https://www.npmjs.com/package/install-nw)

    It downloads the NW.js zip file to ~/.nw-cache (configurable), and then creates a local server for the nw module to download from. For extra measure I threw in multi threaded downloading (8 connections) and download resuming.

    Hopefully I'll get some more time soon to translate all of this into bespoke-pdf

    Chiara Chiappini
    @kul3r4
    Hi, I always get a pdf with 0 pages, I just run gulp
    is there anything else I should do more then configuring the gulpfile
    David Mark Clements
    @davidmarkclements
    Hey @kul3r4 - yah you need to require bespoke-pdf into your main.js file (same place you require bespoke). See the top of the readme - bespoke-pdf is both a gulp task and a bespoke plugin
    Yah
    (Sorry about second "yah" - apparently gitter isn't great with iPad
    Chiara Chiappini
    @kul3r4
    thanks. done it, I still get a pdf with 0 pages. Is there any debug I can enable when running gulp?
    Chiara Chiappini
    @kul3r4
    Also tried from scratch using https://github.com/markdalgleish/generator-bespoke without adding any code, still it generates an empty pdf file
    Chiara Chiappini
    @kul3r4
    I got it: running gulp with sudo is now kicking the generation of the pdf. There must be some error that does not get propagated. Now I am having problems with the images: some of the JPEG are recognized as png by image.js and then fail later