Skip to content

Commit f18ec01

Browse files
committed
document ignore and license tags
1 parent be83591 commit f18ec01

File tree

5 files changed

+107
-17
lines changed

5 files changed

+107
-17
lines changed

content/en/tags-ignore.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,54 @@
11
---
22
tag: ignore
3-
description: \[todo\] Remove this from the final output.
3+
description: Omit a symbol from the documentation.
44
---
55

66
## Overview
77

8-
TODO
8+
The `@ignore` tag indicates that a symbol in your code should never appear in the documentation. This tag takes precedence over all others.
9+
10+
For most JSDoc templates, including the default template, the `@ignore` tag has the following effects:
11+
12+
+ If you use the `@ignore` tag with the `@class` or `@module` tag, the entire class or module will be omitted from the documentation.
13+
+ If you use the `@ignore` tag with the `@namespace` tag, you must also add the `@ignore` tag to any child classes and namespaces. Otherwise, your documentation will show the child classes and namespaces, but with incomplete names.
914

1015

1116
## Examples
1217

13-
{% example "Example goes here" %}
18+
In the following example, `Jacket` and `Jacket#color` will not appear in the documentation.
19+
20+
{% example "Class with `@ignore` tag" %}
21+
22+
```js
23+
/**
24+
* @class
25+
* @ignore
26+
*/
27+
function Jacket() {
28+
/** The jacket's color. */
29+
this.color = null;
30+
}
31+
```
32+
{% endexample %}
33+
34+
In the following example, the `Clothes` namespace contains a `Jacket` class. The `@ignore` tag must be added to both `Clothes` and `Clothes.Jacket`. `Clothes`, `Clothes.Jacket`, and `Clothes.Jacket#color` will not appear in the documentation.
35+
36+
{% example "Namespace with child class" %}
1437

1538
```js
16-
// todo
39+
/**
40+
* @namespace
41+
* @ignore
42+
*/
43+
var Clothes = {
44+
/**
45+
* @class
46+
* @ignore
47+
*/
48+
Jacket: function() {
49+
/** The jacket's color. */
50+
this.color = null;
51+
}
52+
};
1753
```
1854
{% endexample %}

content/en/tags-license.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
---
22
tag: license
3-
description: \[todo\] Document the software license that applies to this code.
3+
description: Identify the license that applies to this code.
44
---
55

6+
## Syntax
7+
8+
`@license <identifier>`
9+
10+
611
## Overview
712

8-
TODO
13+
The `@license` tag identifies the software license that applies to any portion of your code.
914

15+
You can use any text to identify the license you are using. If your code uses a standard open-source license, consider using the appropriate identifier from the [Software Package Data Exchange (SPDX) License List](https://spdx.org/licenses/).
1016

11-
## Examples
1217

18+
## Examples
1319

14-
{% example "Example goes here" %}
20+
{% example "A module that is distributed under the Apache License 2.0" %}
1521

1622
```js
17-
// todo
23+
/**
24+
* Utility functions for the foo package.
25+
* @module foo/util
26+
* @license Apache-2.0
27+
*/
1828
```
1929
{% endexample %}

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h2 id="tag-dictionary">Tag Dictionary</h2>
108108
<dt><a href="tags-global.html">@global</a></dt>
109109
<dd>Document a global object.</dd>
110110
<dt><a href="tags-ignore.html">@ignore</a></dt>
111-
<dd>[todo] Remove this from the final output.</dd>
111+
<dd>Omit a symbol from the documentation.</dd>
112112
<dt><a href="tags-inner.html">@inner</a></dt>
113113
<dd>Document an inner object.</dd>
114114
<dt><a href="tags-instance.html">@instance</a></dt>
@@ -118,7 +118,7 @@ <h2 id="tag-dictionary">Tag Dictionary</h2>
118118
<dt><a href="tags-lends.html">@lends</a></dt>
119119
<dd>Document properties on an object literal as if they belonged to a symbol with a given name.</dd>
120120
<dt><a href="tags-license.html">@license</a></dt>
121-
<dd>[todo] Document the software license that applies to this code.</dd>
121+
<dd>Identify the license that applies to this code.</dd>
122122
<dt><a href="tags-link.html">@link</a></dt>
123123
<dd>Inline tag - create a link.</dd>
124124
<dt><a href="tags-member.html">@member</a> (synonyms: @var)</dt>

tags-ignore.html

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<head>
66
<meta charset="utf-8">
7-
<meta name="description" content="[todo] Remove this from the final output.">
7+
<meta name="description" content="Omit a symbol from the documentation.">
88
<title>Use JSDoc: @ignore</title>
99
<link rel="stylesheet" href="styles/usejsdoc.css">
1010
<link rel="stylesheet" href="styles/prettify.css">
@@ -32,10 +32,42 @@ <h2>Table of Contents</h2>
3232
</li>
3333
</ul>
3434
<h2 id="overview">Overview</h2>
35-
<p>TODO</p>
35+
<p>The <code>@ignore</code> tag indicates that a symbol in your code should never appear in the documentation. This tag takes precedence over all others.</p>
36+
<p>For most JSDoc templates, including the default template, the <code>@ignore</code> tag has the following effects:</p>
37+
<ul>
38+
<li>If you use the <code>@ignore</code> tag with the <code>@class</code> or <code>@module</code> tag, the entire class or module will be omitted from the documentation.</li>
39+
<li>If you use the <code>@ignore</code> tag with the <code>@namespace</code> tag, you must also add the <code>@ignore</code> tag to any child classes and namespaces.
40+
Otherwise, your documentation will show the child classes and namespaces, but with incomplete names.</li>
41+
</ul>
3642
<h2 id="examples">Examples</h2>
43+
<p>In the following example, <code>Jacket</code> and <code>Jacket#color</code> will not appear in the documentation.</p>
44+
<figure>
45+
<figcaption>Class with <code>@ignore</code> tag</figcaption><pre class="prettyprint lang-js"><code>/**
46+
* @class
47+
* @ignore
48+
*/
49+
function Jacket() {
50+
/** The jacket's color. */
51+
this.color = null;
52+
}
53+
</code></pre>
54+
</figure>
55+
<p>In the following example, the <code>Clothes</code> namespace contains a <code>Jacket</code> class. The <code>@ignore</code> tag must be added to both <code>Clothes</code> and <code>Clothes.Jacket</code>. <code>Clothes</code>, <code>Clothes.Jacket</code>, and <code>Clothes.Jacket#color</code> will not appear in the documentation.</p>
3756
<figure>
38-
<figcaption>Example goes here</figcaption><pre class="prettyprint lang-js"><code>// todo
57+
<figcaption>Namespace with child class</figcaption><pre class="prettyprint lang-js"><code>/**
58+
* @namespace
59+
* @ignore
60+
*/
61+
var Clothes = {
62+
/**
63+
* @class
64+
* @ignore
65+
*/
66+
Jacket: function() {
67+
/** The jacket's color. */
68+
this.color = null;
69+
}
70+
};
3971
</code></pre>
4072
</figure>
4173
</article>

tags-license.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<head>
66
<meta charset="utf-8">
7-
<meta name="description" content="[todo] Document the software license that applies to this code.">
7+
<meta name="description" content="Identify the license that applies to this code.">
88
<title>Use JSDoc: @license</title>
99
<link rel="stylesheet" href="styles/usejsdoc.css">
1010
<link rel="stylesheet" href="styles/prettify.css">
@@ -24,18 +24,30 @@
2424
<h1>@license</h1>
2525
<h2>Table of Contents</h2>
2626
<ul>
27+
<li>
28+
<a href="#syntax">Syntax</a>
29+
</li>
2730
<li>
2831
<a href="#overview">Overview</a>
2932
</li>
3033
<li>
3134
<a href="#examples">Examples</a>
3235
</li>
3336
</ul>
37+
<h2 id="syntax">Syntax</h2>
38+
<p><code>@license &lt;identifier&gt;</code>
39+
</p>
3440
<h2 id="overview">Overview</h2>
35-
<p>TODO</p>
41+
<p>The <code>@license</code> tag identifies the software license that applies to any portion of your code.</p>
42+
<p>You can use any text to identify the license you are using. If your code uses a standard open-source license, consider using the appropriate identifier from
43+
the <a href="https://spdx.org/licenses/">Software Package Data Exchange (SPDX) License List</a>.</p>
3644
<h2 id="examples">Examples</h2>
3745
<figure>
38-
<figcaption>Example goes here</figcaption><pre class="prettyprint lang-js"><code>// todo
46+
<figcaption>A module that is distributed under the Apache License 2.0</figcaption><pre class="prettyprint lang-js"><code>/**
47+
* Utility functions for the foo package.
48+
* @module foo/util
49+
* @license Apache-2.0
50+
*/
3951
</code></pre>
4052
</figure>
4153
</article>

0 commit comments

Comments
 (0)