Skip to content

Commit 38be5fe

Browse files
committed
clean up access and public tag docs; don't say that setting access tag to public is a no-op (#106)
1 parent 774edf8 commit 38be5fe

File tree

4 files changed

+39
-21
lines changed

4 files changed

+39
-21
lines changed

content/en/tags-access.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,32 @@ related:
1717

1818
## Overview
1919

20-
The @access tag specifies the access level of a member. Note that "@access private" is the same as "@private", "@access protected" is the same as "@protected", and "@access public" is the same as "@public" which is the same as not including the tag at all. Private members will not show in the output documentation unless JSDoc is given the `--private` option.
20+
The `@access` tag specifies the access level of a member. You can use the `@access` tag as a
21+
synonym for other tags:
2122

22-
Note that a doclet's _access level_ is different from its _scope_. For example, if "Parent" has an inner variable "child" that is documented as @public, "child" will still be treated as an inner variable with the namepath "Parent~child".
23-
To change a doclet's scope, see the [@instance][instance-tag], [@static][static-tag], and [@global][global-tag] tags.
23+
+ `@access private` is the same as `@private`.
24+
+ `@access protected` is the same as `@protected`.
25+
+ `@access public` is the same as `@public`.
2426

27+
Private members are not shown in the generated output unless JSDoc is run with the `-p/--private`
28+
command-line option. In JSDoc 3.3.0 and later, you can also use the [`-a/--access` command-line
29+
option][access-option] to change this behavior.
30+
31+
Note that a doclet's _access level_ is different from its _scope_. For example, if `Parent` has an
32+
inner variable named `child` that is documented as `@public`, the `child` variable will still be
33+
treated as an inner variable with the namepath `Parent~child`. In other words, the `child` variable
34+
will have an inner scope, even though the variable is public. To change a doclet's scope, use the
35+
[`@instance`][instance-tag], [`@static`][static-tag], and [`@global`][global-tag] tags.
36+
37+
[access-option]: about-commandline.html
2538
[global-tag]: tags-global.html
2639
[instance-tag]: tags-instance.html
2740
[static-tag]: tags-static.html
2841

2942

3043
## Examples
3144

32-
{% example "@access is a synonym for @private, @protected, @public." %}
45+
{% example "Using @access as a synonym for other tags" %}
3346

3447
```js
3548
/** @constructor */

content/en/tags-public.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ related:
1212

1313
## Overview
1414

15-
The @public tag indicates that a symbol should be documented as if it were public.
15+
The `@public` tag indicates that a symbol should be documented as if it were public.
1616

1717
By default, JSDoc treats all symbols as public, so using this tag does not normally affect the
18-
generated documentation. However, you may prefer to use the @public tag explicitly so it is clear to
19-
others that you intended to make the symbol public.
18+
generated documentation. However, you may prefer to use the `@public` tag explicitly so it is clear
19+
to others that you intended to make the symbol public.
2020

21-
In contrast to previous version of JSDoc, the @public tag does _not_ affect a symbol's scope. Use
22-
the [@instance][instance-tag], [@static][static-tag], and [@global][global-tag] tags to change a
21+
In JSDoc 3, the `@public` tag does _not_ affect a symbol's scope. Use the
22+
[`@instance`][instance-tag], [`@static`][static-tag], and [`@global`][global-tag] tags to change a
2323
symbol's scope.
2424

2525
[global-tag]: tags-global.html

tags-access.html

+13-7
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,21 @@ <h2 id="syntax">Syntax</h2>
4141
<p><code>@access &lt;private|protected|public&gt;</code>
4242
</p>
4343
<h2 id="overview">Overview</h2>
44-
<p>The @access tag specifies the access level of a member. Note that &quot;@access private&quot; is the same as &quot;@private&quot;, &quot;@access protected&quot;
45-
is the same as &quot;@protected&quot;, and &quot;@access public&quot; is the same as &quot;@public&quot; which is the same as not including the tag at all.
46-
Private members will not show in the output documentation unless JSDoc is given the <code>--private</code> option.</p>
47-
<p>Note that a doclet&#39;s <em>access level</em> is different from its <em>scope</em>. For example, if &quot;Parent&quot; has an inner variable &quot;child&quot;
48-
that is documented as @public, &quot;child&quot; will still be treated as an inner variable with the namepath &quot;Parent~child&quot;. To change a doclet&#39;s
49-
scope, see the <a href="tags-instance.html">@instance</a>, <a href="tags-static.html">@static</a>, and <a href="tags-global.html">@global</a> tags.</p>
44+
<p>The <code>@access</code> tag specifies the access level of a member. You can use the <code>@access</code> tag as a synonym for other tags:</p>
45+
<ul>
46+
<li><code>@access private</code> is the same as <code>@private</code>.</li>
47+
<li><code>@access protected</code> is the same as <code>@protected</code>.</li>
48+
<li><code>@access public</code> is the same as <code>@public</code>.</li>
49+
</ul>
50+
<p>Private members are not shown in the generated output unless JSDoc is run with the <code>-p/--private</code> command-line option. In JSDoc 3.3.0 and later, you
51+
can also use the <a href="about-commandline.html"><code>-a/--access</code> command-line
52+
option</a> to change this behavior.</p>
53+
<p>Note that a doclet&#39;s <em>access level</em> is different from its <em>scope</em>. For example, if <code>Parent</code> has an inner variable named <code>child</code> that is documented as <code>@public</code>, the <code>child</code> variable will still be treated as an inner variable with the namepath <code>Parent~child</code>.
54+
In other words, the <code>child</code> variable will have an inner scope, even though the variable is public. To change a doclet&#39;s scope, use the
55+
<a href="tags-instance.html"><code>@instance</code></a>, <a href="tags-static.html"><code>@static</code></a>, and <a href="tags-global.html"><code>@global</code></a> tags.</p>
5056
<h2 id="examples">Examples</h2>
5157
<figure>
52-
<figcaption>@access is a synonym for @private, @protected, @public.</figcaption><pre class="prettyprint lang-js"><code>/** @constructor */
58+
<figcaption>Using @access as a synonym for other tags</figcaption><pre class="prettyprint lang-js"><code>/** @constructor */
5359
function Thingy() {
5460

5561
/** @access private */

tags-public.html

+4-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ <h2>Table of Contents</h2>
3535
</li>
3636
</ul>
3737
<h2 id="overview">Overview</h2>
38-
<p>The @public tag indicates that a symbol should be documented as if it were public.</p>
39-
<p>By default, JSDoc treats all symbols as public, so using this tag does not normally affect the generated documentation. However, you may prefer to use the @public
40-
tag explicitly so it is clear to others that you intended to make the symbol public.</p>
41-
<p>In contrast to previous version of JSDoc, the @public tag does <em>not</em> affect a symbol&#39;s scope. Use the <a href="tags-instance.html">@instance</a>,
42-
<a href="tags-static.html">@static</a>, and <a href="tags-global.html">@global</a> tags to change a symbol&#39;s scope.</p>
38+
<p>The <code>@public</code> tag indicates that a symbol should be documented as if it were public.</p>
39+
<p>By default, JSDoc treats all symbols as public, so using this tag does not normally affect the generated documentation. However, you may prefer to use the <code>@public</code> tag explicitly so it is clear to others that you intended to make the symbol public.</p>
40+
<p>In JSDoc 3, the <code>@public</code> tag does <em>not</em> affect a symbol&#39;s scope. Use the
41+
<a href="tags-instance.html"><code>@instance</code></a>, <a href="tags-static.html"><code>@static</code></a>, and <a href="tags-global.html"><code>@global</code></a> tags to change a symbol&#39;s scope.</p>
4342
<h2 id="examples">Examples</h2>
4443
<figure>
4544
<figcaption>Using the @public tag</figcaption><pre class="prettyprint lang-js"><code>/**

0 commit comments

Comments
 (0)