diff --git a/.gitignore b/.gitignore index 5ec560fae9..7793b3adab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,5 @@ /build/ol-all.js /build/proj4js-combined.js /build/require-all.js -/demos/*.json -/demos/*.combined.js +/examples/*.json +/examples/*.combined.js diff --git a/Makefile b/Makefile index aab19efb34..316850987b 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,13 @@ PHANTOMJS = phantomjs PLOVR_JAR = bin/plovr-b254c26318c5.jar SPEC = $(shell find test/spec -name \*.js) SRC = $(shell find exports externs src/ol -name \*.js) -EXAMPLES = $(shell find demos -maxdepth 1 -name \*.html) +EXAMPLES = $(shell find examples -maxdepth 1 -name \*.html) comma := , empty := space := $(empty) $(empty) .PHONY: all -all: build-all build demos +all: build-all build examples .PHONY: precommit precommit: lint build-all doc test build @@ -31,26 +31,26 @@ build/ol-all.js: $(PLOVR_JAR) $(SRC) base.json build/ol-all.json build/require-a build/require-all.js: $(SRC) ( echo "goog.require('goog.dom');" ; find src/ol -name \*.js | xargs grep -rh ^goog.provide | sort | uniq | sed -e 's/provide/require/g' ) >$@ -.PHONY: demos -demos: $(subst .html,.json,$(EXAMPLES)) +.PHONY: examples +examples: $(subst .html,.json,$(EXAMPLES)) -demos/%.json: base.json +examples/%.json: base.json @echo "{\"id\": \"$(basename $(notdir $@))\", \"inherits\": \"../base.json\", \"inputs\": \"$(subst .json,.js,$@)\"}" > $@ -demos/%.combined.js: $(PLOVR_JAR) base.json demos/%.js +examples/%.combined.js: $(PLOVR_JAR) base.json examples/%.js java -jar $(PLOVR_JAR) build $(subst .combined.js,.json,$@) >$@ @echo $@ "uncompressed:" $$(wc -c <$@) bytes @echo $@ " compressed:" $$(gzip -9 -c <$@ | wc -c) bytes .PHONY: serve -serve: $(PLOVR_JAR) build/require-all.js demos - java -jar $(PLOVR_JAR) serve build/*.json demos/*.json +serve: $(PLOVR_JAR) build/require-all.js examples + java -jar $(PLOVR_JAR) serve build/*.json examples/*.json .PHONY: lint lint: build/lint-src-timestamp build/lint-spec-timestamp build/lint-src-timestamp: $(SRC) - gjslint --strict --limited_doc_files=$(subst $(space),$(comma),$(shell find externs -name \*.js)) $(SRC) $(filter-out $(shell find demos -name \*.combined.js),$(shell find demos -name \*.js)) && touch $@ + gjslint --strict --limited_doc_files=$(subst $(space),$(comma),$(shell find externs -name \*.js)) $(SRC) $(filter-out $(shell find examples -name \*.combined.js),$(shell find examples -name \*.js)) && touch $@ build/lint-spec-timestamp: $(SPEC) gjslint $(SPEC) && touch $@ @@ -80,8 +80,8 @@ clean: rm -f build/ol.js rm -f build/ol-all.js rm -f build/require-all.js - rm -f demos/*.json - rm -f demos/*.combined.js + rm -f examples/*.json + rm -f examples/*.combined.js rm -rf build/apidoc reallyclean: clean diff --git a/demos/full-screen.html b/examples/full-screen.html similarity index 100% rename from demos/full-screen.html rename to examples/full-screen.html diff --git a/demos/full-screen.js b/examples/full-screen.js similarity index 100% rename from demos/full-screen.js rename to examples/full-screen.js diff --git a/demos/loader.js b/examples/loader.js similarity index 100% rename from demos/loader.js rename to examples/loader.js diff --git a/demos/proj4js.html b/examples/proj4js.html similarity index 100% rename from demos/proj4js.html rename to examples/proj4js.html diff --git a/demos/proj4js.js b/examples/proj4js.js similarity index 100% rename from demos/proj4js.js rename to examples/proj4js.js diff --git a/demos/side-by-side.html b/examples/side-by-side.html similarity index 100% rename from demos/side-by-side.html rename to examples/side-by-side.html diff --git a/demos/side-by-side.js b/examples/side-by-side.js similarity index 100% rename from demos/side-by-side.js rename to examples/side-by-side.js diff --git a/demos/two-layers.html b/examples/two-layers.html similarity index 100% rename from demos/two-layers.html rename to examples/two-layers.html diff --git a/demos/two-layers.js b/examples/two-layers.js similarity index 100% rename from demos/two-layers.js rename to examples/two-layers.js diff --git a/readme.md b/readme.md index 2d5f2d423e..0f02e83eb1 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,7 @@ Run make: ## Run the examples -Run make (as above), then explore the `demos/` directory with your web browser. +Run make (as above), then explore the `examples/` directory with your web browser. ## Run the examples in debug mode @@ -22,9 +22,9 @@ Then, start a simple webserver, for example: $ python -mSimpleHTTPServer -Explore the `demos/` directory through this server, for example . You can turn off compilation by appending `?mode=RAW` to the URL, for example . +Explore the `examples/` directory through this server, for example . You can turn off compilation by appending `?mode=RAW` to the URL, for example . -Note that appending `?mode=RAW` doesn't work with `file://` URLs, which is why you need to access the `demos/` directory though a web server. +Note that appending `?mode=RAW` doesn't work with `file://` URLs, which is why you need to access the `examples/` directory though a web server. ## Run tests