From 64a252093ca7d65c33e2265410027b839cebfe03 Mon Sep 17 00:00:00 2001 From: augustus Date: Wed, 31 Oct 2012 09:39:55 +0100 Subject: [PATCH] Taking over new template from jsdoc but keep modifications by OpenLayers as much as possible --- Makefile | 2 +- doc/index.md | 17 ++++ doc/template/publish.js | 95 +++++++++++-------- .../styles/{apidoc.css => jsdoc-default.css} | 61 ++++++++---- doc/template/tmpl/details.tmpl | 5 +- doc/template/tmpl/example.tmpl | 2 +- doc/template/tmpl/examples.tmpl | 1 + doc/template/tmpl/exceptions.tmpl | 5 +- doc/template/tmpl/fires.tmpl | 1 + doc/template/tmpl/layout.tmpl | 4 +- doc/template/tmpl/mainpage.tmpl | 1 + doc/template/tmpl/members.tmpl | 6 +- doc/template/tmpl/method.tmpl | 5 +- doc/template/tmpl/params.tmpl | 18 +++- doc/template/tmpl/properties.tmpl | 2 +- doc/template/tmpl/returns.tmpl | 5 +- doc/template/tmpl/type.tmpl | 1 + 17 files changed, 156 insertions(+), 75 deletions(-) create mode 100644 doc/index.md rename doc/template/static/styles/{apidoc.css => jsdoc-default.css} (91%) diff --git a/Makefile b/Makefile index 8b5f3fe2ba..6a33b3c8c6 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ doc: build/jsdoc-$(BRANCH)-timestamp build/jsdoc-$(BRANCH)-timestamp: $(SRC) $(shell find doc/template -type f) mkdir -p build/gh-pages/$(BRANCH)/apidoc - $(JSDOC) -t doc/template -r src -d build/gh-pages/$(BRANCH)/apidoc + $(JSDOC) -t doc/template -r src -d build/gh-pages/$(BRANCH)/apidoc doc/index.md touch $@ .PHONY: hostexamples diff --git a/doc/index.md b/doc/index.md new file mode 100644 index 0000000000..1fb377193a --- /dev/null +++ b/doc/index.md @@ -0,0 +1,17 @@ +Finding your way round +---------------------- +See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects. + +In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map. + +Projections +----------- +A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via Proj4js. + +Maps and Layers +--------------- +A map in OpenLayers is essentially a staple of layers that is viewed from the top. Layers are responsible for retieving data and displaying it. + +Contributing +------------ +See CONTRIBUTING.md for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers. \ No newline at end of file diff --git a/doc/template/publish.js b/doc/template/publish.js index 23e9c7d08e..5a0eb1ff81 100644 --- a/doc/template/publish.js +++ b/doc/template/publish.js @@ -2,6 +2,7 @@ var template = require('jsdoc/template'), fs = require('fs'), path = require('path'), + taffy = require('taffydb').taffy, helper = require('jsdoc/util/templateHelper'), scopeToPunc = helper.scopeToPunc, hasOwnProp = Object.prototype.hasOwnProperty, @@ -9,8 +10,9 @@ var template = require('jsdoc/template'), view, outdir = env.opts.destination; -function find(spec, sort) { - return helper.find(data, spec, sort); + +function find(spec) { + return helper.find(data, spec); } function tutoriallink(tutorial) { @@ -26,7 +28,7 @@ var linkto = helper.linkto; var htmlsafe = helper.htmlsafe; function hashToLink(doclet, hash) { - if (!/^(#.+)/.test(hash)) { return hash; } + if ( !/^(#.+)/.test(hash) ) { return hash; } var url = helper.createLink(doclet); @@ -64,7 +66,7 @@ function generate(title, docs, filename) { docs: docs }; - var outpath = outdir + '/' + filename, + var outpath = path.join(outdir, filename), html = view.render('container.tmpl', docData); html = helper.resolveLinks(html); // turn {@link foo} into foo @@ -87,15 +89,28 @@ function generate(title, docs, filename) { function buildNav(members) { var nav = '

Index

', seen = {}; - - function byLongName(a, b) { - return a.longname.localeCompare(b.longname); + + /** + * Sorts elements by their qualified names (property longname). + * See https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort + * @param {object} a + * @param {object} b + * @return {number} + */ + function byLongName(a, b){ + if(a.longname===b.longname){ + return 0; + } else if(a.longname < b.longname){ + return -1; + } else { + return 1; + } } if (members.modules.length) { nav += '

Modules