From b0165e77762921eb3c59bb362aa9bcbf1db6a5fa Mon Sep 17 00:00:00 2001 From: tjvr Date: Sat, 9 Apr 2016 15:10:31 +0100 Subject: [PATCH] Update Readme --- README.md | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 5531129..ac3dfb0 100644 --- a/README.md +++ b/README.md @@ -86,39 +86,21 @@ If you want to host the files yourself, read on. ### In more detail -You need to include jQuery (in the `` of your page): +Include the scratchblocks JS file on your webpage: ```html - + ``` -Then include the scratchblocks CSS and JS: - -```html - - -``` - -Then just call `ncratchblocks2.parse` after the page has loaded, which will -render matching page elements to shiny scratch blocks. Its sole argument is the -CSS-style selector for the elements that contain the scratchblocks code. It -uses `pre.blocks` by default. +Then just call `scratchblocks.renderMatching` after the page has loaded, which +will render matching page elements to shiny scratch blocks. Its sole argument +is the CSS-style selector for the elements that contain the scratchblocks code. +It uses `pre.blocks` by default. ```js -scratchblocks2.parse("pre.blocks"); +scratchblocks.renderMatching("pre.blocks"); ``` -Finally, you need to put `flag.png` and `arrows.png` in the folder -`block_images`, which must be in the same folder as `scratchblocks2.css`. - -In summary, your directory layout should look something like this: - - block_images/ - arrows.png - flag.png - scratchblocks2.css - scratchblocks2.js - ### Inline blocks To use blocks inside a paragraph... @@ -130,7 +112,7 @@ I'm rather fond of the stamp block in Scratch. ...make a separate call to `parse` using the `inline` argument. ```js -scratchblocks2.parse("code.b", {inline: true}); +scratchblocks.renderMatching("code.b", {inline: true}); ```