Skip to content

Commit cbfe471

Browse files
@member: filled out documentation
1 parent bb4bb85 commit cbfe471

File tree

3 files changed

+71
-17
lines changed

3 files changed

+71
-17
lines changed

Jake/articles/tags-member

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
<!--{
22
"title": "@member",
33
"out": "tags-member.html",
4-
"description": "[todo] Document a member."
4+
"description": "Document a member."
55
}-->
6+
<h3>Synonyms</h3>
7+
<ul>
8+
<li>@var</li>
9+
</ul>
10+
11+
<h3>Syntax</h3>
12+
<code>@member [&lt;type&gt;] [&lt;name&gt;]</code>
13+
614
<h3>Overview</h3>
715

816
<p>
17+
The @member tag documents a member (as opposed to a @class or a @function or a ...).
18+
It can optionally have a type as well as a name.
19+
This is the generic kind all objects get unless they have a more specific kind (@class, @function, @constant, ...).
920
</p>
1021

1122
<h3>Examples</h3>
1223

13-
<p>
24+
{{#example}}Using @member to mark Data#point.
25+
/** @class */
26+
function Data() {
27+
/** @member {Object} */
28+
this.point = {};
29+
}
30+
{{/example}}
31+
32+
<p>Here is an example of using @member to document a (virtual) variable 'foo'.
1433
</p>
1534

16-
{{#example}}Example goes here
17-
// todo
35+
{{#example}}Using @member to document a virtual member.
36+
/** A variable in the global namespace called 'foo'.
37+
* @var {number} foo */
1838
{{/example}}
1939

20-
<h3>See Also</h3>
40+
<p>The above is equivalent to:</p>
2141

22-
<ul>
23-
<li><a href="#">...</a></li>
24-
</ul>
42+
{{#example}}
43+
/** A variable in the global namespace called 'foo'.
44+
* @type {number} */
45+
var foo;
46+
{{/example}}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ <h2 name="JSDoc3_Tag_Dictionary" id="JSDoc3_Tag_Dictionary">JSDoc 3 Tag Dictiona
259259
<dd>Use the following text to describe the entire class.</dd> <dt><a href="tags-author.html">@author</a></dt>
260260
<dd>Documents the author of an item.</dd> <dt><a href="tags-kind.html">@kind</a></dt>
261261
<dd>What kind of object is this?</dd> <dt><a href="tags-member.html">@member</a></dt>
262-
<dd>[todo] Document a member.</dd> <dt><a href="tags-since.html">@since</a></dt>
262+
<dd>Document a member.</dd> <dt><a href="tags-since.html">@since</a></dt>
263263
<dd>When was this feature added?</dd> <dt><a href="tags-access.html">@access</a></dt>
264264
<dd>Specify the access level of this member - private, public, or protected.</dd> <dt><a href="tags-borrows.html">@borrows</a></dt>
265265
<dd>This object uses something from another object.</dd> <dt><a href="tags-mixin.html">@mixin</a></dt>

tags-member.html

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<meta name="description" content="[todo] Document a member."><title>Use JSDoc: @member</title>
5+
<meta name="description" content="Document a member."><title>Use JSDoc: @member</title>
66

77
<link rel="stylesheet" href="lib/prettify.css" />
88
<script src="lib/prettify.js"></script>
@@ -176,29 +176,61 @@
176176
<article>
177177
<h1>@member</h1>
178178

179+
<h3>Synonyms</h3>
180+
<ul>
181+
<li>@var</li>
182+
</ul>
183+
184+
<h3>Syntax</h3>
185+
<code>@member [&lt;type&gt;] [&lt;name&gt;]</code>
186+
179187
<h3>Overview</h3>
180188

181189
<p>
190+
The @member tag documents a member (as opposed to a @class or a @function or a ...).
191+
It can optionally have a type as well as a name.
192+
This is the generic kind all objects get unless they have a more specific kind (@class, @function, @constant, ...).
182193
</p>
183194

184195
<h3>Examples</h3>
185196

186-
<p>
197+
<dl class="example">
198+
<dt>Using @member to mark Data#point.</dt>
199+
<dd>
200+
<pre class="prettyprint lang-js">
201+
/** @class */
202+
function Data() {
203+
/** @member {Object} */
204+
this.point = {};
205+
}
206+
207+
</pre>
208+
</dd>
209+
</dl><p>Here is an example of using @member to document a (virtual) variable 'foo'.
187210
</p>
188211

189212
<dl class="example">
190-
<dt>Example goes here</dt>
213+
<dt>Using @member to document a virtual member.</dt>
191214
<dd>
192215
<pre class="prettyprint lang-js">
193-
// todo
216+
/** A variable in the global namespace called 'foo'.
217+
* @var {number} foo */
194218

195219
</pre>
196220
</dd>
197-
</dl><h3>See Also</h3>
221+
</dl><p>The above is equivalent to:</p>
198222

199-
<ul>
200-
<li><a href="#">...</a></li>
201-
</ul>
223+
<dl class="example">
224+
<dt></dt>
225+
<dd>
226+
<pre class="prettyprint lang-js">
227+
/** A variable in the global namespace called 'foo'.
228+
* @type {number} */
229+
var foo;
230+
231+
</pre>
232+
</dd>
233+
</dl>
202234
</article>
203235

204236
<footer>

0 commit comments

Comments
 (0)