Search code examples
meteormeteor-collection2

Meteor: Exporting rendered template for offline use


I have an online tool for users to build and preview slideshow presentations (uploading images, editing text).

Would there be a way to "export" the content of a rendered slideshow for offline use? This would mean the user could view the presentation locally in a browser using only static files.


Solution

  • Use var myRenderedHTML = Blaze.toHTMLWithData(templateYouWantToCache, dataUsedToRenderTemplate);

    Then use something like the Filesaver.js library to force download of that content as an HTML file. (as in the last demo on this page)