Skip to content

Commit e486be0

Browse files
filled out @namespace
1 parent 5b83389 commit e486be0

File tree

3 files changed

+55
-16
lines changed

3 files changed

+55
-16
lines changed

Jake/articles/tags-namespace

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
11
<!--{
22
"title": "@namespace",
33
"out": "tags-namespace.html",
4-
"description": "[todo] Document a namespace object."
4+
"description": "Document a namespace object."
55
}-->
6+
<h3>Syntax</h3>
7+
8+
<code>@namespace [&lt;SomeName&gt;]</code>
9+
610
<h3>Overview</h3>
711

812
<p>
13+
The @namespace tag marks an object as being a namespace.
914
</p>
1015

1116
<h3>Examples</h3>
1217

13-
<p>
14-
</p>
18+
{{#example}}Defining a namespace as an object.
19+
/** A namespace.
20+
* @namespace */
21+
var MyNamespace = {
22+
/** MyNamespace.foo */
23+
foo: function () {},
24+
/** MyNamespace.bar */
25+
bar: 1
26+
};
27+
{{/example}}
1528

16-
{{#example}}Example goes here
17-
// todo
29+
{{#example}}Defining a namespace virtually.
30+
/** A namespace.
31+
* @namespace MyNamespace */
32+
/** A function in MyNamespace (MyNamespace.myFunction)
33+
* @function myFunction
34+
* @memberof MyNamespace */
1835
{{/example}}
1936

2037
<h3>See Also</h3>
2138

2239
<ul>
23-
<li><a href="#">...</a></li>
24-
</ul>
40+
<li><a href="tags-module.html">@module</a></li>
41+
</ul>

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ <h2 name="JSDoc3_Tag_Dictionary" id="JSDoc3_Tag_Dictionary">JSDoc 3 Tag Dictiona
295295
<dd>Describe the object.</dd> <dt><a href="tags-instance.html">@instance</a></dt>
296296
<dd>Document an instance member.</dd> <dt><a href="tags-name.html">@name</a></dt>
297297
<dd>[todo] Document the name of an object.</dd> <dt><a href="tags-namespace.html">@namespace</a></dt>
298-
<dd>[todo] Document a namespace object.</dd> <dt><a href="tags-enum.html">@enum</a></dt>
298+
<dd>Document a namespace object.</dd> <dt><a href="tags-enum.html">@enum</a></dt>
299299
<dd>Document a collection of related properties.</dd> <dt><a href="tags-default.html">@default</a></dt>
300300
<dd>Document the default value.</dd> <dt><a href="tags-private.html">@private</a></dt>
301301
<dd>This member is meant to be private.</dd> <dt><a href="tags-method.html">@method</a></dt>

tags-namespace.html

Lines changed: 30 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 namespace object."><title>Use JSDoc: @namespace</title>
5+
<meta name="description" content="Document a namespace object."><title>Use JSDoc: @namespace</title>
66

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

179+
<h3>Syntax</h3>
180+
181+
<code>@namespace [&lt;SomeName&gt;]</code>
182+
179183
<h3>Overview</h3>
180184

181185
<p>
186+
The @namespace tag marks an object as being a namespace.
182187
</p>
183188

184189
<h3>Examples</h3>
185190

186-
<p>
187-
</p>
188-
189191
<dl class="example">
190-
<dt>Example goes here</dt>
192+
<dt>Defining a namespace as an object.</dt>
191193
<dd>
192194
<pre class="prettyprint lang-js">
193-
// todo
195+
/** A namespace.
196+
* @namespace */
197+
var MyNamespace = {
198+
/** MyNamespace.foo */
199+
foo: function () {},
200+
/** MyNamespace.bar */
201+
bar: 1
202+
};
203+
204+
</pre>
205+
</dd>
206+
</dl><dl class="example">
207+
<dt>Defining a namespace virtually.</dt>
208+
<dd>
209+
<pre class="prettyprint lang-js">
210+
/** A namespace.
211+
* @namespace MyNamespace */
212+
/** A function in MyNamespace (MyNamespace.myFunction)
213+
* @function myFunction
214+
* @memberof MyNamespace */
194215

195216
</pre>
196217
</dd>
197218
</dl><h3>See Also</h3>
198219

199220
<ul>
200-
<li><a href="#">...</a></li>
201-
</ul>
221+
<li><a href="tags-module.html">@module</a></li>
222+
</ul>
223+
202224
</article>
203225

204226
<footer>

0 commit comments

Comments
 (0)