Explain how to add examples in readme.md

This commit is contained in:
Éric Lemoine
2012-09-28 14:21:02 +02:00
parent da5ad0bf20
commit f60af3910f

View File

@@ -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=<example_name>` 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=<example_name>` script tag to refer to a valid URL. `make serve`
triggers the `examples` target which creates Plovr JSON file for each example.