diff --git a/_config.yml b/_config.yml index 5f49eba..c9549c2 100644 --- a/_config.yml +++ b/_config.yml @@ -1,4 +1,4 @@ permalink: /:categories/:title.html auto: true pygments: true -baseurl: /bonsai-docs/ \ No newline at end of file +baseurl: /bonsai-docs diff --git a/_layouts/doc.html b/_layouts/doc.html index 18a4de4..6c7c3c8 100644 --- a/_layouts/doc.html +++ b/_layouts/doc.html @@ -1,8 +1,8 @@ - - + + Bonsai documentation - {{page.title}} @@ -11,10 +11,10 @@ - \ No newline at end of file + + + + + + + diff --git a/_site/api/Shape.html b/_site/api/Shape.html index dcaf68d..1ce20c0 100644 --- a/_site/api/Shape.html +++ b/_site/api/Shape.html @@ -24,7 +24,18 @@

Bonsai

Shape

-

Shape constructor

+

Try it out:

+
var a = Shape.circle(100, -50, 50);
+a.attr('fillColor', 'lightblue').addTo(stage);
+
+a.animate('1s', {
+  scale: 1.5,
+  fillColor: 'darkblue',
+  y: 100
+}, { easing: 'bounceOut' });
+
+
+

Shape constructor

The Shape constructor accepts three different argument signatures:

@@ -76,4 +87,12 @@

Factories/Helpers

- \ No newline at end of file + + + + + + + diff --git a/_site/assets/doc.js b/_site/assets/doc.js new file mode 100644 index 0000000..fcbbd76 --- /dev/null +++ b/_site/assets/doc.js @@ -0,0 +1,83 @@ + var doc = { + + init: function() { + doc.forEachRunnableCodeBlock(doc.makeRunnable); + }, + + /** + * Gathers aggregate text of node + */ + _innerText: function(node) { + if (node.nodeType === 3) { + return node.data; + } + var txt = ''; + if (node = node.firstChild) do { + txt += doc._innerText(node); + } while (node = node.nextSibling); + return txt; + }, + + forEachRunnableCodeBlock: function(fn) { + $('div.highlight').each(function(i, block) { + if (block.previousSibling.nodeType === 8 && block.previousSibling.data === 'runnable') { + fn(block, doc._innerText(block)); + } + }); + }, + + makeRunnable: function(block, code) { + + block = $(block); + + var height = Math.max(200, block.height()), + width = 700; + + var dom = $('
'); + dom.nav = $('