From f60af3910f98242818dc269f7700e75eeb0632c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 28 Sep 2012 14:21:02 +0200 Subject: [PATCH] Explain how to add examples in readme.md --- readme.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/readme.md b/readme.md index 3dce12cca9..a1a14c76bf 100644 --- a/readme.md +++ b/readme.md @@ -45,3 +45,18 @@ Linter](https://developers.google.com/closure/utilities/docs/linter_howto). Then: $ make lint + +## Add examples + +The examples are located in the `examples` directory. Adding a new example +implies creating two files in this directory, a `.html` file and `.js` file. +See `examples/full-screen.html` and `examples/full-screen.js` for instance. + +The `.html` file needs to include a script tag with +`loader.js?id=` as its `src`. For example, if the two files for +the examples are `myexample.js` and `myexample.html` then `id` should be set to +`myexample` in the `loader.js` URL. + +`make serve` should be stopped and restarted for the +`loader.js?id=` script tag to refer to a valid URL. `make serve` +triggers the `examples` target which creates Plovr JSON file for each example.