toolness / p5.js-widget

A reusable widget for embedding editable p5 sketches in web pages.
https://toolness.github.io/p5.js-widget/
GNU Lesser General Public License v2.1
162 stars 44 forks source link

Allow embedder to specify default widget options in p5-widget.js's script tag #49

Open toolness opened 8 years ago

toolness commented 8 years ago

For example, if an embedder has 10 widgets on their page and wants to specify a different p5 version for each of them, it'd be nice if they could just do:

<script src="//toolness.github.io/p5.js-widget/p5-widget.js"
        data-p5-version="0.4.2"></script>

Instead of having to explicitly specify the data-p5-version on all 10 <script type="text/p5"> elements.