mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Added support in default template for modules that are also classes.
This commit is contained in:
parent
a8cd6b59de
commit
51c8046fcc
3
node_modules/jsdoc/tag.js
generated
vendored
3
node_modules/jsdoc/tag.js
generated
vendored
@ -107,8 +107,9 @@
|
||||
|
||||
/**
|
||||
Parse the parameter name and parameter desc from the tag text.
|
||||
@private
|
||||
@inner
|
||||
@method parseParamText
|
||||
@memberof module:jsdoc/tag
|
||||
@param {string} tagText
|
||||
@returns {Array.<string, string, boolean, boolean>} [pname, pdesc, poptional, pdefault].
|
||||
*/
|
||||
|
||||
@ -220,6 +220,7 @@
|
||||
|
||||
nav = nav + '</ul>';
|
||||
}
|
||||
|
||||
var namespaceNames = data.get( data.find({kind: 'namespace'}) );
|
||||
if (namespaceNames.length) {
|
||||
nav = nav + '<h3>Namespaces</h3><ul>';
|
||||
@ -230,17 +231,25 @@
|
||||
|
||||
nav = nav + '</ul>';
|
||||
}
|
||||
|
||||
var classNames = data.get( data.find({kind: 'class'}) );
|
||||
if (classNames.length) {
|
||||
nav = nav + '<h3>Classes</h3><ul>';
|
||||
classNames.forEach(function(c) {
|
||||
if ( !seen.hasOwnProperty(c.longname) ) nav += '<li>'+linkto(c.longname, c.name)+'</li>';
|
||||
var moduleSameName = data.get( data.find({kind: 'module', longname: c.longname}) );
|
||||
if (moduleSameName) {
|
||||
c.name = c.name.replace('module:', 'require(')+')';
|
||||
moduleSameName[0].module = c;
|
||||
}
|
||||
|
||||
if (!seen.hasOwnProperty(c.longname) ) nav += '<li>'+linkto(c.longname, c.name)+'</li>';
|
||||
seen[c.longname] = true;
|
||||
});
|
||||
|
||||
nav = nav + '</ul>';
|
||||
}
|
||||
|
||||
//console.log('classNames', classNames);
|
||||
|
||||
var globalNames = data.get( data.find({kind: ['property', 'function'], 'memberof': {'isUndefined': true}}) );
|
||||
|
||||
if (globalNames.length) {
|
||||
|
||||
@ -50,6 +50,10 @@
|
||||
|
||||
<article>
|
||||
<?js
|
||||
if (doc.kind === 'module' && doc.module) {
|
||||
print(render('method.tmpl', doc.module));
|
||||
}
|
||||
|
||||
if (doc.kind === 'class') {
|
||||
print(render('method.tmpl', doc));
|
||||
}
|
||||
|
||||
20
test/cases/moduletag3.js
Normal file
20
test/cases/moduletag3.js
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
@module foo/Photo/manager
|
||||
@desc Manage a collection of photos.
|
||||
*/
|
||||
|
||||
/**
|
||||
Construct a new Photo manager
|
||||
@constructor module:foo/Photo/manager
|
||||
@param {String} collectionId The identifier of the managed collection.
|
||||
*/
|
||||
module.exports = function(collectionId) {
|
||||
|
||||
/**
|
||||
@function module:foo/Photo/manager#getPhoto
|
||||
@param {String} photoName
|
||||
*/
|
||||
this.getPhoto = function() {}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user