diff --git a/LICENSE.md b/LICENSE.md
index 4437cd5c..ba2d2fb9 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -7,7 +7,7 @@ compliance with the License. You have permission to use it for commercial,
non-commercial, or any other purpose you like, according to the
License below.
-Copyright (c) 2010, 2011 Michael Mathews
+Copyright (c) 2011 Michael Mathews
All rights reserved.
You may obtain a copy of the License at
@@ -158,33 +158,19 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
You may obtain the source code for sqlitejdbc at
https://github.com/crawshaw/sqlitejdbc
-MustacheJS (templates/lib/janl/mustache.js)
+Underscore Template (templates/lib/underscore/template.js)
----
-Copyright (c) 2009 Chris Wanstrath (Ruby)
-Copyright (c) 2010 Jan Lehnardt (JavaScript)
+Underscore.js 1.1.4
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+Copyright (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
-You may obtain the source code for MustacheJS at
-https://github.com/janl/mustache.js
+Underscore is freely distributable under the MIT license.
+Portions of Underscore are inspired or borrowed from Prototype,
+Oliver Steele's Functional, and John Resig's Micro-Templating.
+
+For all details and documentation:
+http://documentcloud.github.com/underscore/#template
TaffyDB (modules/typicaljoe/taffy.js)
----
diff --git a/modules/janl/mustache.js b/modules/janl/mustache.js
deleted file mode 100644
index caae3181..00000000
--- a/modules/janl/mustache.js
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * CommonJS-compatible mustache.js module
- *
- * See http://github.com/janl/mustache.js for more info.
- */
-
-/*
- mustache.js — Logic-less templates in JavaScript
-
- See http://mustache.github.com/ for more info.
-*/
-
-var Mustache = function() {
- var Renderer = function() {};
-
- Renderer.prototype = {
- otag: "{{",
- ctag: "}}",
- pragmas: {},
- buffer: [],
- pragmas_implemented: {
- "IMPLICIT-ITERATOR": true,
- "ARRAY-ORDINALS": true // define #first? and #last? when looping arrays
- },
- context: {},
-
- render: function(template, context, partials, in_recursion) {
- // reset buffer & set context
- if(!in_recursion) {
- this.context = context;
- this.buffer = []; // TODO: make this non-lazy
- }
-
- // fail fast
- if(!this.includes("", template)) {
- if(in_recursion) {
- return template;
- } else {
- this.send(template);
- return;
- }
- }
-
- template = this.render_pragmas(template);
- var html = this.render_section(template, context, partials);
- if(in_recursion) {
- return this.render_tags(html, context, partials, in_recursion);
- }
-
- this.render_tags(html, context, partials, in_recursion);
- },
-
- /*
- Sends parsed lines
- */
- send: function(line) {
- if(line != "") {
- this.buffer.push(line);
- }
- },
-
- /*
- Looks for %PRAGMAS
- */
- render_pragmas: function(template) {
- // no pragmas
- if(!this.includes("%", template)) {
- return template;
- }
-
- var that = this;
- var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
- this.ctag);
- return template.replace(regex, function(match, pragma, options) {
- if(!that.pragmas_implemented[pragma]) {
- throw({message:
- "This implementation of mustache doesn't understand the '" +
- pragma + "' pragma"});
- }
- that.pragmas[pragma] = {};
- if(options) {
- var opts = options.split("=");
- that.pragmas[pragma][opts[0]] = opts[1];
- }
- return "";
- // ignore unknown pragmas silently
- });
- },
-
- /*
- Tries to find a partial in the curent scope and render it
- */
- render_partial: function(name, context, partials) {
- name = this.trim(name);
- if(!partials || partials[name] === undefined) {
- throw({message: "unknown_partial '" + name + "'"});
- }
- if(typeof(context[name]) != "object") {
- return this.render(partials[name], context, partials, true);
- }
- return this.render(partials[name], context[name], partials, true);
- },
-
- /*
- Renders inverted (^) and normal (#) sections
- */
- render_section: function(template, context, partials) {
- if(!this.includes("#", template) && !this.includes("^", template)) {
- return template;
- }
-
- var that = this;
- // CSW - Added "+?" so it finds the tighest bound, not the widest
- var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
- "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag +
- "\\s*", "mg");
-
- // for each {{#foo}}{{/foo}} section do...
- return template.replace(regex, function(match, type, name, content) {
- var value = that.find(name, context);
- if(type == "^") { // inverted section
- if(!value || that.is_array(value) && value.length === 0) {
- // false or empty list, render it
- return that.render(content, context, partials, true);
- } else {
- return "";
- }
- } else if(type == "#") { // normal section
- if(that.is_array(value)) { // Enumerable, Let's loop!
- var len = value.length;
- return value.map(function(row, i) {
- return that.render(content, that.create_context(row, {first: i === 0, last: i === len-1}),
- partials, true);
- }).join("");
- } else if(that.is_object(value)) { // Object, Use it as subcontext!
- return that.render(content, that.create_context(value),
- partials, true);
- } else if(typeof value === "function") {
- // higher order section
- return value.call(context, content, function(text) {
- return that.render(text, context, partials, true);
- });
- } else if(value) { // boolean section
- return that.render(content, context, partials, true);
- } else {
- return "";
- }
- }
- });
- },
-
- /*
- Replace {{foo}} and friends with values from our view
- */
- render_tags: function(template, context, partials, in_recursion) {
- // tit for tat
- var that = this;
-
- var new_regex = function() {
- return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" +
- that.ctag + "+", "g");
- };
-
- var regex = new_regex();
- var tag_replace_callback = function(match, operator, name) {
- switch(operator) {
- case "!": // ignore comments
- return "";
- case "=": // set new delimiters, rebuild the replace regexp
- that.set_delimiters(name);
- regex = new_regex();
- return "";
- case ">": // render partial
- return that.render_partial(name, context, partials);
- case "{": // the triple mustache is unescaped
- return that.find(name, context);
- default: // escape the value
- return that.escape(that.find(name, context));
- }
- };
- var lines = template.split("\n");
- for(var i = 0; i < lines.length; i++) {
- lines[i] = lines[i].replace(regex, tag_replace_callback, this);
- if(!in_recursion) {
- this.send(lines[i]);
- }
- }
-
- if(in_recursion) {
- return lines.join("\n");
- }
- },
-
- set_delimiters: function(delimiters) {
- var dels = delimiters.split(" ");
- this.otag = this.escape_regex(dels[0]);
- this.ctag = this.escape_regex(dels[1]);
- },
-
- escape_regex: function(text) {
- // thank you Simon Willison
- if(!arguments.callee.sRE) {
- var specials = [
- '/', '.', '*', '+', '?', '|',
- '(', ')', '[', ']', '{', '}', '\\'
- ];
- arguments.callee.sRE = new RegExp(
- '(\\' + specials.join('|\\') + ')', 'g'
- );
- }
- return text.replace(arguments.callee.sRE, '\\$1');
- },
-
- /*
- find `name` in current `context`. That is find me a value
- from the view object
- */
- find: function(name, context) {
- name = this.trim(name);
-
- // Checks whether a value is thruthy or false or 0
- function is_kinda_truthy(bool) {
- return bool === false || bool === 0 || bool;
- }
-
- var value;
- if(is_kinda_truthy(context[name])) {
- value = context[name];
- } else if(is_kinda_truthy(this.context[name])) {
- value = this.context[name];
- }
-
- if(typeof value === "function") {
- return value.apply(context);
- }
- if(value !== undefined) {
- return value;
- }
- // silently ignore unkown variables
- return "";
- },
-
- // Utility methods
-
- /* includes tag */
- includes: function(needle, haystack) {
- return haystack.indexOf(this.otag + needle) != -1;
- },
-
- /*
- Does away with nasty characters
- */
- escape: function(s) {
- s = String(s === null ? "" : s);
- return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) {
- switch(s) {
- case "&": return "&";
- case "\\": return "\\\\";
- case '"': return '"';
- case "'": return ''';
- case "<": return "<";
- case ">": return ">";
- default: return s;
- }
- });
- },
-
- // by @langalex, support for arrays of strings
- create_context: function(_context, opts) {
- if(this.is_object(_context)) {
- if (this.pragmas["ARRAY-ORDINALS"] && opts) {
- _context['first?'] = opts.first || false;
- _context['last?'] = opts.last || false;
- }
- return _context;
- } else {
- var iterator = ".";
- if(this.pragmas["IMPLICIT-ITERATOR"]) {
- iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
- }
- var ctx = {};
- ctx[iterator] = _context;
- if (this.pragmas["ARRAY-ORDINALS"] && opts){
- ctx['first?'] = opts.first || false;
- ctx['last?'] = opts.last || false;
- }
- return ctx;
- }
- },
-
- is_object: function(a) {
- return a && typeof a == "object";
- },
-
- is_array: function(a) {
- return Object.prototype.toString.call(a) === '[object Array]';
- },
-
- /*
- Gets rid of leading and trailing whitespace
- */
- trim: function(s) {
- return s.replace(/^\s*|\s*$/g, "");
- },
-
- /*
- Why, why, why? Because IE. Cry, cry cry.
- */
- map: function(array, fn) {
- if (typeof array.map == "function") {
- return array.map(fn);
- } else {
- var r = [];
- var l = array.length;
- for(var i = 0; i < l; i++) {
- r.push(fn(array[i]));
- }
- return r;
- }
- }
- };
-
- return({
- name: "mustache.js",
- version: "0.3.1-dev",
-
- /*
- Turns a template and view into HTML
- */
- to_html: function(template, view, partials, send_fun) {
- var renderer = new Renderer();
- if(send_fun) {
- renderer.send = send_fun;
- }
- renderer.render(template, view, partials);
- if(!send_fun) {
- return renderer.buffer.join("\n");
- }
- }
- });
-}();
-
-exports.name = Mustache.name;
-exports.version = Mustache.version;
-
-exports.to_html = function() {
- return Mustache.to_html.apply(this, arguments);
-};
diff --git a/modules/jsdoc/name.js b/modules/jsdoc/name.js
index bfd7c352..b247dbcb 100644
--- a/modules/jsdoc/name.js
+++ b/modules/jsdoc/name.js
@@ -142,7 +142,7 @@
longname = longname.replace( /\.prototype\.?/g, '#' );
var parts = longname?
- longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ).reverse()
+ (longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ) || []).reverse()
: [''];
var name = parts[0],
diff --git a/modules/jsdoc/src/parser.js b/modules/jsdoc/src/parser.js
index daa6b722..070c6fe2 100644
--- a/modules/jsdoc/src/parser.js
+++ b/modules/jsdoc/src/parser.js
@@ -14,7 +14,7 @@
* @class
* @mixes module:common/events.*
*
- * @example
+ * @example Create a new parser.
* var jsdocParser = new (require('jsdoc/src/parser').Parser)();
*/
exports.Parser = function() {
@@ -25,7 +25,7 @@
/**
* Parse the given source files for JSDoc comments.
- * @param {Array} sourceFiles
+ * @param {Array.} sourceFiles An array of filepaths to the JavaScript sources.
* @param {string} [encoding=utf8]
*
* @fires jsdocCommentFound
@@ -34,7 +34,7 @@
* @fires fileBegin
* @fires fileComplete
*
- * @example
+ * @example Parse two source files.
* var myFiles = ['file1.js', 'file2.js'];
* var docs = jsdocParser.parse(myFiles);
*/
@@ -127,6 +127,7 @@
/**
* Given a node, determine what the node is a member of.
* @param {astnode} node
+ * @returns {string} The long name of the node that this is a member of.
*/
exports.Parser.prototype.astnodeToMemberof = function(node) {
var memberof = {};
@@ -479,8 +480,8 @@
Fired whenever the parser encounters a JSDoc comment in the current source code.
@event jsdocCommentFound
@memberof module:jsdoc/src/parser.Parser
- @param e
- @param e.comment The text content of the JSDoc comment
- @param e.lineno The line number associated with the found comment.
- @param e.filename The file name associated with the found comment.
+ @param {event} e
+ @param {string} e.comment The text content of the JSDoc comment
+ @param {number} e.lineno The line number associated with the found comment.
+ @param {string} e.filename The file name associated with the found comment.
*/
\ No newline at end of file
diff --git a/modules/jsdoc/tag/dictionary.js b/modules/jsdoc/tag/dictionary.js
index a99630a8..b0484168 100644
--- a/modules/jsdoc/tag/dictionary.js
+++ b/modules/jsdoc/tag/dictionary.js
@@ -1,17 +1,14 @@
/**
- @module jsdoc/tag/dictionary
-
+ @overview
@author Michael Mathews
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
(function() {
var _synonyms = {},
_definitions = {},
- _namespaces = [],
- dictionary;
+ _namespaces = [];
- /** @constructor */
- function TagDefinition(title, etc) {
+ function _TagDefinition(title, etc) {
etc = etc || {};
this.title = dictionary.normalise(title);
@@ -23,14 +20,16 @@
}
}
- TagDefinition.prototype.synonym = function(synonymName) {
+ _TagDefinition.prototype.synonym = function(synonymName) {
_synonyms[synonymName.toLowerCase()] = this.title;
return this; // chainable
}
- dictionary = {
+ /** @exports jsdoc/tag/dictionary */
+ var dictionary = {
+ /** @function */
defineTag: function(title, opts) {
- _definitions[title] = new TagDefinition(title, opts);
+ _definitions[title] = new _TagDefinition(title, opts);
if (opts.isNamespace) {
_namespaces.push(title);
@@ -39,6 +38,7 @@
return _definitions[title];
},
+ /** @function */
lookUp: function(title) {
title = dictionary.normalise(title);
@@ -49,10 +49,12 @@
return false;
},
+ /** @function */
isNamespace: function(kind) {
return ( ~ _namespaces.indexOf(kind) );
},
+ /** @function */
normalise: function(title) {
canonicalName = title.toLowerCase();
diff --git a/modules/jsdoc/tag/dictionary/definitions.js b/modules/jsdoc/tag/dictionary/definitions.js
index 4e33e3b8..6214f73e 100644
--- a/modules/jsdoc/tag/dictionary/definitions.js
+++ b/modules/jsdoc/tag/dictionary/definitions.js
@@ -58,15 +58,17 @@
dictionary.defineTag('class', {
onTagged: function(doclet, tag) {
+ doclet.addTag('kind', 'class');
+
// handle special case where both @class and @constructor tags exist in same doclet
if (tag.originalTitle === 'class') {
- if ( /@construct(s|or)\b/i.test(doclet.comment) ) {
+ var looksLikeDesc = (tag.value || '').match(/\S+\s+\S+/); // multiple words after @class?
+ if ( looksLikeDesc || /@construct(s|or)\b/i.test(doclet.comment) ) {
doclet.classdesc = tag.value; // treat the @class tag as a @classdesc tag instead
return;
}
}
- doclet.addTag('kind', 'class');
setDocletNameToValue(doclet, tag);
}
})
@@ -97,8 +99,7 @@
mustHaveValue: true,
onTagged: function(doclet, tag) {
var ownerClassName = firstWordOf(tag.value);
- doclet.addTag('alias', ownerClassName/* + '.constructor'*/);
- //doclet.addTag('memberof', ownerClassName);
+ doclet.addTag('alias', ownerClassName);
doclet.addTag('kind', 'class');
}
});
@@ -172,7 +173,7 @@
doclet.addTag('alias', modName);
doclet.addTag('kind', 'module');
- doclet.addTag('undocumented');
+ //doclet.addTag('undocumented');
}
})
.synonym('defines');
diff --git a/package.json b/package.json
index ae59bd47..282285c8 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "jsdoc",
"version": "3.0.0beta1",
- "revision": "2011-02-11-2113",
+ "revision": "2011-02-24-1703",
"description": "An automatic documentation generator for javascript.",
"keywords": [ "documentation", "javascript" ],
"licenses": [
diff --git a/templates/default/publish.js b/templates/default/publish.js
index cc322ce7..c82edd2b 100644
--- a/templates/default/publish.js
+++ b/templates/default/publish.js
@@ -1,7 +1,10 @@
(function() {
- var Mustache = require('janl/mustache'),
+ var template = require('underscore/template'),
fs = require('fs');
+
+ template.settings.evaluate = /<\?js([\s\S]+?)\?>/g;
+ template.settings.interpolate = /<\?js=([\s\S]+?)\?>/g;
/**
@global
@@ -9,27 +12,49 @@
@param {object} opts
*/
publish = function(data, opts) {
- var out = '';
+ var out = '',
+ containerTemplate = template.render(fs.read(BASEDIR + 'templates/default/tmpl/container.tmpl'));
- var helpers = {
- linkTo: function() {
- return function(text, render) {
- var linkTo,
- text = render(text);
-
- if ( !data.find({longname: text}).length ) { return text; }
-
- linkTo = text.replace(/#/g, '%23');
- return '' + text + ' ';
- }
+ function render(tmpl, partialData) {
+ var renderFunction = arguments.callee.cache[tmpl];
+ if (!renderFunction) {
+ renderFunction = arguments.callee.cache[tmpl] = template.render(fs.read(BASEDIR + 'templates/default/tmpl/'+tmpl));
}
- };
+ partialData.render = arguments.callee;
+ partialData.find = find;
+ partialData.htmlsafe = htmlsafe;
+
+ return renderFunction.call(partialData, partialData);
+ }
+ render.cache = {};
+
+ function find(spec) {
+ return data.get( data.find(spec) );
+ }
+
+ function htmlsafe(str) {
+ return str.replace(/' + text + '';
+// }
+// }
+// };
function summarize(doclet) {
var desc = doclet.description || '';
desc = desc.replace(/<\/?p>/gi, ''); // full text may be HTML, remove P wrapper
- desc = trim(desc);
+ desc = desc.trim();
var m;
@@ -37,132 +62,108 @@
doclet.summary = m[1];
doclet.description = m[2]? m[2] : '';
}
+
+ doclet.signature = '';
+ doclet.attribs = '';
}
- function trim(text) {
- return text.replace(/^\s+|\s+$/g, '');
- }
-
- data.remove({undocumented: true});
-
- var packageInfo = (data.get( data.find({kind: 'package'}) ) || []) [0];
-
- // add template helpers
- data.forEach(function(doclet) {
- doclet.hasParams = doclet.params && doclet.params.length > 0;
- doclet.hasReturns = doclet.returns && doclet.returns.length > 0;
- doclet.hasBorrowed = doclet.borrowed && doclet.borrowed.length > 0;
- doclet.hasExceptions = doclet.exceptions && doclet.exceptions.length > 0;
- doclet.hasExamples = doclet.examples && doclet.examples.length > 0;
-
- summarize(doclet);
- });
-
- data.orderBy(['longname', 'kind']);
-
- var containerTemplate = fs.read(BASEDIR + 'templates/default/tmpl/container.mustache');
- var partials = {
- paramsTemplate: fs.read(BASEDIR + 'templates/default/tmpl/params.mustache'),
- returnsTemplate: fs.read(BASEDIR + 'templates/default/tmpl/returns.mustache'),
- methodsTemplate: fs.read(BASEDIR + 'templates/default/tmpl/methods.mustache'),
- propertiesTemplate: fs.read(BASEDIR + 'templates/default/tmpl/properties.mustache'),
- examplesTemplate: fs.read(BASEDIR + 'templates/default/tmpl/example.mustache'),
- namespacesTemplate: fs.read(BASEDIR + 'templates/default/tmpl/namespaces.mustache'),
-
- classesTemplate: fs.read(BASEDIR + 'templates/default/tmpl/classes.mustache'),
- exceptionsTemplate: fs.read(BASEDIR + 'templates/default/tmpl/exceptions.mustache')
- };
-
- var topLevels = {
- projects: [],
- globals: [],
- modules: [],
- namespaces: [],
- classes: [],
- mixins: []
- };
-
- topLevels.globals = data.get( data.find({memberof: {isUndefined: true}}) );
-
- var modules = data.get( data.find({kind: 'module'}) ),
- classes = data.get( data.find({kind: 'class'}) ),
- namespaces = data.get( data.find({kind: 'namespace'}) );
-
- modules.forEach(function(m) {
- m.methods = data.get( data.find({kind: 'function', memberof: m.longname}) );
- m.hasMethods = (m.methods && m.methods.length > 0);
- m.methods.forEach(prepareFunc);
-
- m.properties = data.get( data.find({kind: 'property', memberof: m.longname}) );
- m.hasProperties = (m.properties && m.properties.length > 0);
- m.properties.forEach(prepareProp);
-
- m.namespaces = data.get( data.find({kind: 'namespace', memberof: m.longname}) );
- m.hasNamespaces = (m.namespaces && m.namespaces.length > 0);
- m.namespaces.forEach(prepareNs);
-
- m.classes = data.get( data.find({kind: 'class', memberof: m.longname}) );
- m.hasClasses = (m.classes && m.classes.length > 0);
-
- // TODO: namespaces
- });
-
- classes.forEach(function(c) {
- c.methods = data.get( data.find({kind: 'function', memberof: c.longname}) );
- c.hasMethods = (c.methods && c.methods.length > 0);
- prepareFunc(c);
- c.hasConstructor = true;
- c.methods.forEach(prepareFunc);
-
- c.properties = data.get( data.find({kind: 'property', memberof: c.longname}) );
- c.hasProperties = (c.properties && c.properties.length > 0);
- c.properties.forEach(prepareProp);
-
- c.namespaces = data.get( data.find({kind: 'namespace', memberof: c.longname}) );
- c.hasNamespaces = (c.namespaces && c.namespaces.length > 0);
- c.namespaces.forEach(prepareNs);
-
- c.classes = data.get( data.find({kind: 'class', memberof: c.longname}) );
- c.hasClasses = (c.classes && c.classes.length > 0);
- });
-
- namespaces.forEach(function(n) {
-
- n.methods = data.get( data.find({kind: 'function', memberof: n.longname}) );
- n.hasMethods = (n.methods && n.methods.length > 0);
- //prepareNs(n);
- n.methods.forEach(prepareFunc);
-
- n.properties = data.get( data.find({kind: 'property', memberof: n.longname}) );
- n.hasProperties = (n.properties && n.properties.length > 0);
- n.properties.forEach(prepareProp);
-
- n.namespaces = data.get( data.find({kind: 'namespace', memberof: n.longname}) );
- n.hasNamespaces = (n.namespaces && n.namespaces.length > 0);
- n.namespaces.forEach(prepareNs);
-
- n.classes = data.get( data.find({kind: 'class', memberof: n.longname}) );
- n.hasClasses = (n.classes && n.classes.length > 0);
- });
-
- function prepareFunc(f) {
+ function addSignatureParams(f) {
var pnames = [];
if (f.params) {
f.params.forEach(function(p) {
- if (p.name && p.name.indexOf('.') === -1) { pnames.push(p.name); }
+ if (p.name && p.name.indexOf('.') === -1) {
+ if (p.optional) { pnames.push('['+p.name+']'); }
+ else { pnames.push(p.name); }
+ }
});
}
- f.synopsis = (f.kind === 'class'? 'new ' : '') + f.name+'('+pnames.join(', ')+')'
- f.hasParams = (f.params && f.params.length > 0);
- f.hasReturns = (f.returns && f.returns.length > 0);
+
+ f.signature = (f.signature || '') + '('+pnames.join(', ')+')';
}
- function prepareProp(p) {
+ function addSignatureReturns(f) {
+ var returnTypes = [];
+
+ if (f.returns) {
+ f.returns.forEach(function(r) {
+ if (r.type && r.type.names) {
+ returnTypes = r.type.names;
+ }
+ });
+ }
+
+ f.signature = (f.signature || '') + ''+htmlsafe(returnTypes.length? ' ⇒ '+returnTypes.join('|') : '')+' ';
}
- function prepareNs(p) {
+ function addSignatureType(f) {
+ var types = [];
+
+ if (f.type && f.type.names) {
+ types = f.type.names;
+ }
+
+ f.signature = (f.signature || '') + ''+htmlsafe(types.length? ' :'+types.join('|') : '')+' ';
}
+ function addAttribs(f) {
+ var attribs = [];
+
+ if (f.access && f.access !== 'public') {
+ attribs.push(f.access);
+ }
+
+ if (f.scope && f.scope !== 'instance') {
+ if (f.kind == 'function' || f.kind == 'property') attribs.push(f.scope);
+ }
+
+ if (f.readonly === true) {
+ if (f.kind == 'property') attribs.push('readonly');
+ }
+
+ f.attribs = ''+htmlsafe(attribs.length? '<'+attribs.join(', ')+'> ' : '')+' ';
+ }
+
+ data.remove({undocumented: true});
+
+ var packageInfo = (data.get( data.find({kind: 'package'}) ) || []) [0];
+
+ data.forEach(function(doclet) {
+ summarize(doclet);
+ if (doclet.kind === 'function' || doclet.kind === 'class') {
+ addSignatureParams(doclet);
+ addSignatureReturns(doclet);
+ addAttribs(doclet);
+ }
+
+ if (doclet.kind === 'property') {
+ addSignatureType(doclet);
+ addAttribs(doclet)
+ }
+
+ if (doclet.examples) {
+ doclet.examples = doclet.examples.map(function(example) {
+ var caption, code;
+
+ if (example.match(/^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) {
+ caption = RegExp.$1;
+ code = RegExp.$3;
+ }
+
+ return {
+ caption: caption || '',
+ code: code || example
+ };
+ });
+ }
+ });
+
+ data.orderBy(['longname', 'kind', 'version', 'since']);
+
+ // kinds of containers
+ var globals = data.get( data.find({kind: ['property', 'function'], memberof: {isUndefined: true}}) ),
+ modules = data.get( data.find({kind: 'module'}) ),
+ namespaces = data.get( data.find({kind: 'namespace'}) );
+
var outdir = opts.destination;
if (packageInfo) {
outdir += '/' + packageInfo.name + '/' + packageInfo.version + '/';
@@ -172,36 +173,53 @@
// copy static files to outdir
var fromDir = BASEDIR + 'templates/default/static',
staticFiles = fs.ls(fromDir, 3);
+
staticFiles.forEach(function(fileName) {
var toDir = fs.toDir(fileName.replace(fromDir, outdir));
fs.mkPath(toDir);
fs.copyFile(fileName, toDir);
});
-
-
// containers
- generate('Modules', modules, 'modules.html');
- generate('Classes', classes, 'classes.html');
- generate('Namespaces', namespaces, 'namespaces.html');
-//dump(classes)
+ //generate('Globals', globals, 'globals.html');
+ //generate('Modules', modules, 'modules.html');
+ //generate('Classes', classes, 'classes.html');
+ //generate('Namespaces', namespaces, 'namespaces.html');
+
+ var urlToLongname = {},
+ longnameToUrl = {};
+
+ var classes = data.get(data.find({kind: 'class'}));
+ for (var i = 0, len = classes.length; i < len; i++) {
+ var longname = classes[i].longname,
+ urlSafe = longname.replace(/[^$a-z0-9._-]/gi, '_');
+
+ // bidirectional lookups: url <=> longname
+ urlToLongname[urlSafe] = longname;
+ longnameToUrl[longname] = urlSafe;
+ }
+
+ for (var longname in longnameToUrl) {
+ var classes = data.get( data.find({kind: 'class', longname: longname}) );
+ generate(classes[0].kind+': '+classes[0].name, classes, longnameToUrl[longname]+'.html');
+ }
+
function generate(title, docs, filename) {
+ var data = {
+ title: title,
+ docs: docs,
+
+ // helpers
+ render: render,
+ find: find,
+ htmlsafe: htmlsafe
+ };
+
var path = outdir + '/' + filename,
- html = Mustache.to_html(
- containerTemplate,
- {
- title: title,
- docs: docs,
- linkTo: helpers.linkTo
- },
- partials
- );
+ html = containerTemplate.call(data, data);
+
fs.write(path, html)
}
-
}
-
-
-
})();
\ No newline at end of file
diff --git a/templates/default/static/styles/jsdoc-default.css b/templates/default/static/styles/jsdoc-default.css
index 0cf7841f..2bf38c54 100644
--- a/templates/default/static/styles/jsdoc-default.css
+++ b/templates/default/static/styles/jsdoc-default.css
@@ -1,233 +1,155 @@
-.kind { font-style: italic; }
-
-.constructor, .mixin, .namespace
+body
{
- font-weight: bold;
- color: #780000;
+ font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, Tahoma, sans-serif;
+ font-size: 13px;
+ color: #000;
+ background-color: #E2ECF0;
}
-.property { color: #666; }
-.function { color: #666; }
-.access { color: #666; }
-
-h1, h2, h3, h4, h5, h6
+header
{
- font-family: "Bitstream Vera Sans", "DejaVu Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans serif;
- font-weight: bold;
+ display: block;
+ /*border-bottom: 1px solid #ddd;*/
+ padding: 6px 4px;
}
-.page-title
-{
- font-family: "Bitstream Vera Sans", "DejaVu Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans serif;
- font-size: 3.5em;
- font-weight: bolder;
- margin: 0 0 0.1em;
- color: #FFF;
-}
-
-.section-title
-{
- font-size: 2.5em;
- margin: 0;
- color: #798D3E;
+.class-description {
+ font-style: italic;
+ font-family: Palatino, "Palatino Linotype", serif;
+ font-size: 18px;
}
section
{
- border: 1px solid #ccc;
- border-radius: 15px;
- -moz-border-radius: 8px;
display: block;
- padding: 0.75em 0.5em 0.5em 1em;
- margin: 0.5em 0.5em 1em 1em;
+ margin: 14px 28px;
+ background-color: #fff;
+ padding: 12px 24px;
+ -moz-border-radius: 7px;
+ border-radius: 7px
+}
+
+h1
+{
+ font-size: 32px;
+ font-weight: bold;
+ letter-spacing: -0.03em;
+ margin: 6px 0 9px 0;
+}
+
+h2
+{
+ font-size: 22px;
+ font-weight: bold;
+ letter-spacing: -0.03em;
+ margin: 6px 0 3px 0;
+}
+
+h3
+{
+ font-size: 20px;
+ font-weight: bold;
+ letter-spacing: -0.03em;
+ margin-top: 16px;
+ margin: 6px 0 3px 0;
+}
+
+h4
+{
+ font-size: 18px;
+ font-weight: bold;
+ letter-spacing: -0.03em;
+ margin-top: 16px;
+ margin: 18px 0 3px 0;
+ color: #A35A00;
+}
+
+h5
+{
+ font-size: 16px;
+ font-weight: bold;
+ letter-spacing: -0.03em;
+ margin: 6px 0 3px 0;
+}
+
+h6
+{
+ font-size: 13px;
+ letter-spacing: -0.03em;
+ margin: 6px 0 3px 0;
+ font-style: italic;
+}
+
+.ancestor-name {
+ color: #ccc;
+}
+
+.type-signature {
+ color: #aaa;
+}
+
+/*.description {
+ font-family: Palatino, "Palatino Linotype", serif;
+ font-size: 14px;
+}*/
+
+.code-caption
+{
+ font-style: italic;
+ font-family: Palatino, "Palatino Linotype", serif;
+ font-size: 14px;
+ margin: 0;
+}
+
+.sh_sourceCode
+{
+ border: 1px solid #ddd;
+ width: 80%;
+}
+
+.sh_sourceCode code
+{
+ font-family: Consolas, "Lucida Console", Monaco, monospace;
+ font-size: 12px;
+ line-height: 18px;
+ display: block;
+ padding: 4px 12px;
+ margin: 0;
background-color: #fff;
color: #000;
+ border-left: 3px #1C02A3 solid;
}
-.subsection-title
+.params
{
- font-size: 1.9em;
- margin: 0.5em 0 1em;
- color: #000;
+ border-spacing: 0;
+ border: 0;
+ border-collapse: collapse;
}
-.method-title, .class-title
+.params .name { color: #1C02A3; }
+
+.params td, .params th
{
- font-size: 1.7em;
- margin: 0 0 1em 1em;
- color: #7B1A3F;
+ border: 1px solid #ddd;
+ margin: 0px;
+ text-align: left;
+ vertical-align: top;
+ padding: 4px 6px;
+ display: table-cell;
}
-.detail-list { list-style-type: none; }
-
-html
+.params thead tr
{
- /* stops IE resizing fonts by a massive amount */
- font-size: 100%;
-}
-
-body
-{
- /* fixes monospace font sizes in webkit */
- /* following line is picked up by IE6 & 7, which cannot resize pixel-based font sizes */
- *font-size: 62.5%;
- font-size: 0.8em;
- font-family: verdana, sans-serif;
- /*overflow: hidden;*/
- zoom: 1;
- /*background: url(images/pagebg.png) 0 73px repeat-x;*/
- color: #eee;
- background-color: #22252a;
-}
-
-a:link, a:visited
-{
- color: #356a8b;
- text-decoration: none;
- border-bottom: 1px dotted #356a8b;
-}
-
-a:hover, a:active
-{
- color: #298FB2;
- border-color: #298FB2;
- border-bottom-style: solid;
-}
-
-a.image { border: 0; }
-
-p
-{
- margin: 0 0 1em 0;
- line-height: 1.5;
-}
-
-code { font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }
-
-dl.params dt
-{
- border-top: 1px solid #b2b1b1;
- color: #298FB2;
+ background-color: #ddd;
font-weight: bold;
- padding-top: 8px;
- margin-bottom: 5px;
- font-size: 1.1em;
- float: none;
- overflow: visible;
- zoom: 0;
}
-dl.params dt.first
+.params .params thead tr
{
- border-top: none;
- padding-top: 0;
- margin-top: 0;
-}
-
-dl.params dd
-{
- border-width: 0;
- margin-bottom: 16px;
-}
-
-dl.param-properties
-{
- font-style: italic;
- overflow: hidden;
- zoom: 1;
- font-size: 0.9em;
- margin: 1em 0;
-}
-
-dl.param-properties dt span,
-dl.param-properties dd
-{
- color: #555;
- float: left;
- margin: 0;
- padding: 0;
- display: inline;
- margin-bottom: 5px;
- font-size: 1em;
- border: none;
-}
-
-dl.param-properties dt
-{
- clear: both;
- display: inline;
- font-size: 1em;
- padding: 0;
- float: none;
- overflow: visible;
- zoom: 0;
-}
-
-dl.param-properties dt span
-{
- width: 85px;
- clear: both;
-}
-
-.no-docs
-{
- font-style: italic;
- font-weight: lighter;
- color: #666;
-}
-
-.property { margin-left: 30px; }
-
-.property-head
-{
- margin-left: -20px;
- display: block;
- line-height: 1.2em;
-}
-
-.property-name
-{
- float: left;
- margin: 0;
- padding: 0 10px 0 0;
- font-style: italic;
+ background-color: #fff;
font-weight: bold;
- font-size: 1.2em;
- color: #4782B5;
}
-.property-summary
-{
- color: #999;
- font-size: 1em;
-}
-
-.property-details
-{
- clear: both;
- overflow: hidden;
-}
-
-.property-details dt
-{
- font-weight: bold;
- margin-bottom: 4px;
- padding-left: 10px;
- clear: left;
- float: left;
-}
-
-.property-details dd { padding-left: 60px; }
-.property-deprecated { text-decoration: line-through; }
-
-.example-code
-{
- padding: 2px 2px 2px 10px;
- margin-right: 24px;
- color: #fff;
- background-color: #444;
- border-radius: 2px;
- -moz-border-radius: 2px;
-}
-
-.yesDef { text-indent: -5000px; }
\ No newline at end of file
+.params th { border-right: 1px solid #aaa; }
+.params thead .last { border-right: 1px solid #ddd; }
\ No newline at end of file
diff --git a/templates/default/static/styles/node-dark.css b/templates/default/static/styles/node-dark.css
index 234e127d..5849e234 100644
--- a/templates/default/static/styles/node-dark.css
+++ b/templates/default/static/styles/node-dark.css
@@ -1,26 +1,150 @@
-.sh_sourceCode {
-
+ .sh_sourceCode {
+ background-color: #ffffff;
+ color: #000000;
font-weight: normal;
font-style: normal;
}
-.sh_sourceCode .sh_symbol , .sh_sourceCode .sh_cbracket {
- color: #fff;
+ .sh_sourceCode .sh_keyword {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
}
-.sh_sourceCode .sh_keyword
-{
- font-style: italic;
- color: #ECDDAA;
+ .sh_sourceCode .sh_type {
+ color: #a52a2a;
+ font-weight: bold;
+ font-style: normal;
}
-.sh_sourceCode .sh_string, .sh_sourceCode .sh_regexp, .sh_sourceCode .sh_number,
-.sh_sourceCode .sh_specialchar
-{
- color: #B0C4DE;
+ .sh_sourceCode .sh_string {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
}
-.sh_sourceCode .sh_comment {
- color: #777;
+ .sh_sourceCode .sh_regexp {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
}
+ .sh_sourceCode .sh_specialchar {
+ color: #2e8b57;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_comment {
+ color: #000000;
+ font-weight: normal;
+ font-style: italic;
+}
+
+ .sh_sourceCode .sh_number {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_preproc {
+ color: #27408b;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_symbol {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_function {
+ color: #000000;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_cbracket {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_url {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_date {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_time {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_file {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_ip {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_name {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_variable {
+ color: #dda0dd;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_oldfile {
+ color: #2e8b57;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_newfile {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_difflines {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_selector {
+ color: #dda0dd;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_property {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+ .sh_sourceCode .sh_value {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
diff --git a/templates/default/tmpl/classes.mustache b/templates/default/tmpl/classes.mustache
deleted file mode 100644
index 819548df..00000000
--- a/templates/default/tmpl/classes.mustache
+++ /dev/null
@@ -1,10 +0,0 @@
-
-{{#classes}}
-
-
-
-
- {{#summary}}{{{summary}}}
{{/summary}}
-
-{{/classes}}
-
diff --git a/templates/default/tmpl/container.mustache b/templates/default/tmpl/container.mustache
deleted file mode 100644
index 34692572..00000000
--- a/templates/default/tmpl/container.mustache
+++ /dev/null
@@ -1,82 +0,0 @@
-{{%ARRAY-ORDINALS}}
-
-
-
-
- JSDoc: {{title}}
-
-
-
-
-
-
-
-
-
-
-
- {{title}}
-
-{{#docs}}
-
- {{kind}}: {{name}}
-
- {{#classdesc}}
- {{classdesc}}
- {{/classdesc}}
-
- {{#summary}}
- {{summary}}
- {{/summary}}
-
- {{#description}}
- {{description}}
- {{/description}}
-
- {{#hasConstructor}}
- Constructor:
-
- {{>methodsTemplate}}
-
- {{/hasConstructor}}
-
- {{#hasClasses}}
- Classes:
- {{>classesTemplate}}
- {{/hasClasses}}
-
- {{#hasNamespaces}}
- Namespaces:
- {{>namespacesTemplate}}
- {{/hasNamespaces}}
-
- Methods:
- {{#hasMethods}}
-
- {{#methods}}
- {{>methodsTemplate}}
- {{/methods}}
-
- {{/hasMethods}}
- {{^hasMethods}}
- The {{name}} {{kind}} has no documented methods.
- {{/hasMethods}}
-
- Properties:
- {{#hasProperties}}
-
- {{#properties}}
- {{>propertiesTemplate}}
- {{/properties}}
-
- {{/hasProperties}}
- {{^hasProperties}}
- The {{name}} {{kind}} has no documented properties.
- {{/hasProperties}}
-
-
-{{/docs}}
-
-
-
-
\ No newline at end of file
diff --git a/templates/default/tmpl/container.tmpl b/templates/default/tmpl/container.tmpl
new file mode 100644
index 00000000..9f874e77
--- /dev/null
+++ b/templates/default/tmpl/container.tmpl
@@ -0,0 +1,176 @@
+
+
+
+
+ JSDoc:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
');
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
Extends
+
+
+
+
+
+
+
+
Borrows From
+
+
+
+
+
+
+
+
Classes
+
+
+
+
+
+
+
+
+
+
+
Namespaces
+
+
+
+
+
+
+
+
+
+
+
Properties
+
+
+
+
+
+
+
+
Methods
+
+
+
+
+
+
+
+
Events
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/default/tmpl/example.mustache b/templates/default/tmpl/example.mustache
deleted file mode 100644
index 089ac843..00000000
--- a/templates/default/tmpl/example.mustache
+++ /dev/null
@@ -1,12 +0,0 @@
-
- Example
-
-
- {{#examples}}
-
-
-
- {{/examples}}
-
diff --git a/templates/default/tmpl/example.tmpl b/templates/default/tmpl/example.tmpl
new file mode 100644
index 00000000..47a10889
--- /dev/null
+++ b/templates/default/tmpl/example.tmpl
@@ -0,0 +1,2 @@
+
+
diff --git a/templates/default/tmpl/examples.tmpl b/templates/default/tmpl/examples.tmpl
new file mode 100644
index 00000000..fdf78762
--- /dev/null
+++ b/templates/default/tmpl/examples.tmpl
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/default/tmpl/exceptions.mustache b/templates/default/tmpl/exceptions.mustache
deleted file mode 100644
index 3ff8169b..00000000
--- a/templates/default/tmpl/exceptions.mustache
+++ /dev/null
@@ -1,28 +0,0 @@
-
- {{#exceptions}}
-
-
-
-
-
- {{#type}}
-
- Type
-
-
- {{#names}}
- {{#linkTo}}{{.}}{{/linkTo}} {{^last?}} | {{/last?}}{{#last?}} {{/last?}}
- {{/names}}
-
- {{/type}}
-
-
- {{#description}}
-
- {{description}}
-
- {{/description}}
-
-
- {{/exceptions}}
-
\ No newline at end of file
diff --git a/templates/default/tmpl/exceptions.tmpl b/templates/default/tmpl/exceptions.tmpl
new file mode 100644
index 00000000..e4449867
--- /dev/null
+++ b/templates/default/tmpl/exceptions.tmpl
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+ Type
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/default/tmpl/fires.tmpl b/templates/default/tmpl/fires.tmpl
new file mode 100644
index 00000000..1eef451f
--- /dev/null
+++ b/templates/default/tmpl/fires.tmpl
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/templates/default/tmpl/index.mustache b/templates/default/tmpl/index.mustache
deleted file mode 100644
index 88819e65..00000000
--- a/templates/default/tmpl/index.mustache
+++ /dev/null
@@ -1,189 +0,0 @@
-{{%ARRAY-ORDINALS}}
-
-
-
-
- JSDoc Index
-
-
-
-
-
-{{title}}
-
-
-{{#docs}}
-
- {{#kind}}{{kind}} {{/kind}}{{#access}}<{{access}}> {{/access}}{{longname}}
-
- {{#summary}}{{{summary}}}{{/summary}}
-
-
-
-
-
- {{#description}}
-
- {{{description}}}
-
- {{/description}}
-
- {{#hasBorrowed}}
-
Mixes In:
-
- {{#borrowed}} {{#linkTo}}{{from}}{{/linkTo}} {{/borrowed}}
-
- {{/hasBorrowed}}
-
- {{#hasParams}}
-
Parameters:
- {{>paramsTemplate}}
- {{/hasParams}}
-
- {{#hasReturns}}
-
Returns:
- {{>returnsTemplate}}
- {{/hasReturns}}
-
-
-{{/docs}}
-
-
-
-
\ No newline at end of file
diff --git a/templates/default/tmpl/method.tmpl b/templates/default/tmpl/method.tmpl
new file mode 100644
index 00000000..7bc5eccc
--- /dev/null
+++ b/templates/default/tmpl/method.tmpl
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+ Description:
+
+
+
+
+
+ Parameters:');
+ print( render('params.tmpl', params) );
+ }
+ ?>
+
+
+ Fires:
+
+
+
+
+ Throws:
+
+
+
+ Returns:');
+ print(''+rdesc.join('
')+'
');
+ }
+ }
+ ?>
+
+ Example' + (examples.length > 1? 's':'') + '');
+ print( render('examples.tmpl', examples) );
+ }
+ ?>
+
+
diff --git a/templates/default/tmpl/methods.mustache b/templates/default/tmpl/methods.mustache
deleted file mode 100644
index b7e621b8..00000000
--- a/templates/default/tmpl/methods.mustache
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- {{name}}
-
-
- {{#summary}}{{{summary}}}
{{/summary}}
-
-
-
-
Synopsis:
-
{{synopsis}}
-
- {{#hasParams}}
-
Parameters:
- {{>paramsTemplate}}
- {{/hasParams}}
-
- {{#hasExceptions}}
-
Throws:
- {{>exceptionsTemplate}}
- {{/hasExceptions}}
-
- {{#hasReturns}}
-
Returns:
- {{>returnsTemplate}}
- {{/hasReturns}}
-
- {{#hasExamples}}
- {{>examplesTemplate}}
- {{/hasExamples}}
-
-
-
diff --git a/templates/default/tmpl/namespaces.mustache b/templates/default/tmpl/namespaces.mustache
deleted file mode 100644
index a42cc1a6..00000000
--- a/templates/default/tmpl/namespaces.mustache
+++ /dev/null
@@ -1,10 +0,0 @@
-
-{{#namespaces}}
-
-
-
-
- {{#summary}}{{{summary}}}
{{/summary}}
-
-{{/namespaces}}
-
diff --git a/templates/default/tmpl/params.mustache b/templates/default/tmpl/params.mustache
deleted file mode 100644
index 5b8e8d90..00000000
--- a/templates/default/tmpl/params.mustache
+++ /dev/null
@@ -1,53 +0,0 @@
-
- {{#params}}
-
-
- {{name}}
-
-
-
-
- {{#type}}
-
- Type
-
-
- {{#names}}
- {{#linkTo}}{{.}}{{/linkTo}} {{^last?}} | {{/last?}}{{#last?}} {{/last?}}
- {{/names}}
-
-
- {{#defaultvalue}}
-
- Default
-
-
- {{defaultvalue}}
-
- {{/defaultvalue}}
-
- {{#optional}}
-
- Optional
-
- Yes
- {{/optional}}
-
- {{#nullable}}
-
- Nullable
-
- Yes
- {{/nullable}}
- {{/type}}
-
-
- {{#description}}
-
- {{description}}
-
- {{/description}}
-
-
- {{/params}}
-
\ No newline at end of file
diff --git a/templates/default/tmpl/params.tmpl b/templates/default/tmpl/params.tmpl
new file mode 100644
index 00000000..86575693
--- /dev/null
+++ b/templates/default/tmpl/params.tmpl
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ' );
+ }
+
+ if (param.nullable) {
+ print( '<nullable> ' );
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+ Properties' + render('params.tmpl', param.subparams) );
+ }?>
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/default/tmpl/properties.mustache b/templates/default/tmpl/properties.mustache
deleted file mode 100644
index 341b5384..00000000
--- a/templates/default/tmpl/properties.mustache
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
- {{name}}
-
-
- {{{summary}}}
-
-
-
- {{#description}}
-
- Description
-
-
- {{{description}}}
-
-
- {{/description}}
-
- {{#deprecated}}
-
- Deprecated
-
-
- {{{deprecated}}}
-
-
- {{/deprecated}}
-
- {{#since}}
-
- Since
-
-
- {{{since}}}
-
-
- {{/since}}
-
- {{#type}}
-
- Type
-
-
- {{#names}}
- {{#linkTo}}{{.}}{{/linkTo}} {{^last?}} | {{/last?}}{{#last?}} {{/last?}}
- {{/names}}
-
-
- {{/type}}
-
- {{#readonly}}
-
- Readonly
-
-
- Yes
-
-
- {{/readonly}}
-
- {{#nullable}}
-
- Nullable
-
-
- Yes
-
-
- {{/nullable}}
-
- {{#defaultvalue}}
-
- Default
-
-
- {{defaultvalue}}
-
-
- {{/defaultvalue}}
-
- {{#hasExamples}}
- {{>examplesTemplate}}
- {{/hasExamples}
-
-
\ No newline at end of file
diff --git a/templates/default/tmpl/properties.tmpl b/templates/default/tmpl/properties.tmpl
new file mode 100644
index 00000000..b4950fe5
--- /dev/null
+++ b/templates/default/tmpl/properties.tmpl
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+ Description:
+
+
+
+
+
+
+
+
+ Deprecated
+ Yes
+
+
+
+ Since
+
+
+
+
+ Read-Only
+ Yes
+
+
+
+ Default Value
+
+
+
+
+
+ Example' + (examples.length > 1? 's':'') + '');
+ print( render('examples.tmpl', examples) );
+ }
+ ?>
+
diff --git a/templates/default/tmpl/returns.mustache b/templates/default/tmpl/returns.mustache
deleted file mode 100644
index c9d1dc69..00000000
--- a/templates/default/tmpl/returns.mustache
+++ /dev/null
@@ -1,28 +0,0 @@
-
- {{#returns}}
-
-
-
-
-
- {{#type}}
-
- Type
-
-
- {{#names}}
- {{#linkTo}}{{.}}{{/linkTo}} {{^last?}} | {{/last?}}{{#last?}} {{/last?}}
- {{/names}}
-
- {{/type}}
-
-
- {{#description}}
-
- {{description}}
-
- {{/description}}
-
-
- {{/returns}}
-
\ No newline at end of file
diff --git a/templates/default/tmpl/returns.tmpl b/templates/default/tmpl/returns.tmpl
new file mode 100644
index 00000000..464d67f0
--- /dev/null
+++ b/templates/default/tmpl/returns.tmpl
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+ Type
+
+
+
+
+
+
+
+
+
\ No newline at end of file