bespoke-run

Run your code snippets in Bespoke.js


Keywords
bespoke.js-plugin, code execution, run, example
License
MIT
Install
npm install bespoke-run@1.0.1

Documentation

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

This plugin is shipped in a UMD format, meaning that it is available as a CommonJS/AMD module or browser global.

For example, when using CommonJS modules:


```js
var bespoke = require('bespoke'),
  classes = require('bespoke-classes');
  camera = require('bespoke-run');

bespoke.from('article', [
  classes(),
  run()
]);

When using browser globals:

bespoke.from('article', [
  bespoke.plugins.classes(),
  bespoke.plugins.run()
]);

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>

Package managers

Bower

$ bower install bespoke-run

npm

$ npm install bespoke-run

Credits

This plugin was built with generator-bespokeplugin.

License

MIT License