Skip to content

Commit

Permalink
Rename old @Property tag to @member.
Browse files Browse the repository at this point in the history
  • Loading branch information
micmath committed Sep 24, 2011
1 parent f37bd95 commit 31161fc
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 54 deletions.
2 changes: 1 addition & 1 deletion rhino_modules/jsdoc/doclet.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function codetypeToKind(type) {
var kind = (type || '').toLowerCase();

if (kind !== 'function') {
return 'property';
return 'member';
}

return kind;
Expand Down
2 changes: 1 addition & 1 deletion rhino_modules/jsdoc/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ exports.jsdocSchema = {
"kind": { // what kind of symbol is this?
"type": "string",
"maxItems": 1,
"enum": ["constructor", "module", "event", "namespace", "method", "property", "enum", "class", "interface", "constant", "mixin", "file", "version"]
"enum": ["constructor", "module", "event", "namespace", "method", "member", "enum", "class", "interface", "constant", "mixin", "file", "version"]
},
"refersto": { // the path to another doc: this doc is simply a renamed alias to that
"type": "string",
Expand Down
27 changes: 14 additions & 13 deletions rhino_modules/jsdoc/tag/dictionary/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ exports.defineTags = function(dictionary) {
onTagged: function(doclet, tag) {
setDocletMemberof(doclet, tag);
}
})
.synonym('member');
});

dictionary.defineTag('mixin', {
onTagged: function(doclet, tag) {
Expand Down Expand Up @@ -352,20 +351,22 @@ exports.defineTags = function(dictionary) {
dictionary.defineTag('property', {
canHaveType: true,
onTagged: function(doclet, tag) {
if (doclet.kind) {
if (!doclet.properties) { doclet.properties = []; }
doclet.properties.push(tag.value);
}
else {
setDocletKindToTitle(doclet, tag);
setDocletNameToValue(doclet, tag);
if (tag.value && tag.value.type) {
doclet.type = tag.value.type;
}
if (!doclet.properties) { doclet.properties = []; }
doclet.properties.push(tag.value);
}
})
.synonym('prop');

dictionary.defineTag('member', {
canHaveType: true,
onTagged: function(doclet, tag) {
setDocletKindToTitle(doclet, tag);
setDocletNameToValue(doclet, tag);
if (tag.value && tag.value.type) {
doclet.type = tag.value.type;
}
}
})
.synonym('prop')
.synonym('var');

dictionary.defineTag('protected', {
Expand Down
10 changes: 5 additions & 5 deletions templates/default/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@
}

if (f.scope && f.scope !== 'instance') {
if (f.kind == 'function' || f.kind == 'property') attribs.push(f.scope);
if (f.kind == 'function' || f.kind == 'member') attribs.push(f.scope);
}

if (f.readonly === true) {
if (f.kind == 'property') attribs.push('readonly');
if (f.kind == 'member') attribs.push('readonly');
}

f.attribs = '<span class="type-signature">'+htmlsafe(attribs.length? '<'+attribs.join(', ')+'> ' : '')+'</span>';
Expand All @@ -126,7 +126,7 @@
addAttribs(doclet);
}

if (doclet.kind === 'property') {
if (doclet.kind === 'member') {
addSignatureType(doclet);
addAttribs(doclet)
}
Expand Down Expand Up @@ -156,7 +156,7 @@
data.orderBy(['longname', 'version', 'since']);

// kinds of containers
var globals = find( {kind: ['property', 'function'], memberof: {isUndefined: true}} ),
var globals = find( {kind: ['member', 'function'], memberof: {isUndefined: true}} ),
modules = find({kind: 'module'}),
externals = find({kind: 'external'}),
mixins = find({kind: 'mixin'}),
Expand Down Expand Up @@ -262,7 +262,7 @@
nav = nav + '</ul>';
}

var globalNames = find({kind: ['property', 'function'], 'memberof': {'isUndefined': true}});
var globalNames = find({kind: ['member', 'function'], 'memberof': {'isUndefined': true}});

if (globalNames.length) {
nav = nav + '<h3>Global</h3><ul>';
Expand Down
12 changes: 6 additions & 6 deletions templates/default/tmpl/container.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@
<?js } ?>

<?js
var properties = find({kind: 'property', memberof: doc.longname});
var members = find({kind: 'member', memberof: doc.longname});
if (title === 'Globals') {
properties = find({kind: 'property', memberof: {isUndefined: true}});
members = find({kind: 'member', memberof: {isUndefined: true}});
}
if (properties && properties.length && properties.forEach) {
if (members && members.length && members.forEach) {
?>

<h3 class="subsection-title">Properties</h3>
<h3 class="subsection-title">Members</h3>

<dl><?js
properties.forEach(function(p) {
print(render('properties.tmpl', p));
members.forEach(function(p) {
print(render('members.tmpl', p));
});
?></dl>

Expand Down
24 changes: 0 additions & 24 deletions templates/default/tmpl/properties.tmpl
Original file line number Diff line number Diff line change
@@ -1,24 +0,0 @@

<dt id="property:<?js= longname ?>">
<h4 class="name"><?js= this.attribs + name + this.signature ?></h4>

<?js if (this.summary) { ?>
<p class="summary"><?js= summary ?></p>
<?js } ?>
</dt>
<dd>
<?js if (this.description) { ?>
<p class="description">
<?js= this.description ?>
</p>
<?js } ?>

<?js print(render('details.tmpl', this)); ?>

<?js
if (this.examples && examples.length) {
print('<h5>Example' + (examples.length > 1? 's':'') + '</h5>');
print( render('examples.tmpl', examples) );
}
?>
</dd>
4 changes: 2 additions & 2 deletions test/cases/memberoftag.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/** @constructor
@member mathlib
@memberof mathlib
*/
function Data() {

/** @property */
/** @member */
this.point = {};
}

Expand Down
2 changes: 1 addition & 1 deletion test/cases/quotename.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ chat["#channel"] = {};


/**
@property
@member
@type {boolean}
@defaultvalue
*/
Expand Down
2 changes: 1 addition & 1 deletion test/cases/typekind.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ module.exports = require('connect').createServer(
);

/**
@property {number} module:blog/server.port
@member {number} module:blog/server.port
@default 8080
*/

0 comments on commit 31161fc

Please sign in to comment.