bespoke-run

Run your code snippets in Bespoke.js

npm install bespoke-run
8 downloads in the last week
8 downloads in the last month

Build Status

bespoke-run

Run your code snippets in Bespoke.js

Download

Download the production version or the development version, or use a package manager.

Usage

First, include both bespoke.js and bespoke-run.js in your page.

Then, simply include the plugin when instantiating your presentation.

bespoke.from('article', {
  run: true
});

When you want to run a piece of code in your browser, just put it between <code></code> tags, then add an anchor with the 'data-bespoke-run' property, like so:

<section>
  <code>alert(2 + 2)</code>
  <a data-bespoke-run>Run!</a>
</section>

If you want your code snippet to run automatically before advancing to the next slide, just do:

<section>
  <code data-bespoke-autorun>alert(2 + 2)</code>
</section>

Incompatibilities

This module has to be included before 'bullets', like so:

bespoke.from('article', {
  run: true,
  bullets: true
});

Package managers

Bower

$ bower install bespoke-run

npm

$ npm install bespoke-run

The bespoke-run npm package is designed for use with browserify, e.g.

require('bespoke');
require('bespoke-run');

Credits

This plugin was built with generator-bespokeplugin.

License

MIT License

npm loves you