Skip to content

Commit babfab0

Browse files
committed
docs: Format tags & variables instead of quoting
1 parent 40b3b1e commit babfab0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+188
-188
lines changed

content/en/about-commandline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ At its most basic level, JSDoc is used like so:
1111

1212
where `...` are paths to other files to generate documentation for.
1313

14-
Additionally, one may provide the path to a [Markdown file][md-file] (ending in ".md") or a file
15-
named "README", and this will be added to the documentation on the front page. See [these
14+
Additionally, one may provide the path to a [Markdown file][md-file] (ending in `.md`) or a file
15+
named `README`, and this will be added to the documentation on the front page. See [these
1616
instructions][including-readme].
1717

1818
JSDoc supports a number of command-line options, many of which have both long and short forms.

content/en/about-configuring-jsdoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ use the [`-r` command-line option][about-commandline] to recurse into subdirecto
177177
this array may include subdirectories of the paths in `source.include`.
178178
+ `source.includePattern`: An optional string, interpreted as a regular expression. If present, all
179179
filenames must match this regular expression to be processed by JSDoc. By default, this option is
180-
set to ".+\.js(doc|x)?$", meaning that only files with the extensions `.js`, `.jsdoc`, and
180+
set to `.+\.js(doc|x)?$`, meaning that only files with the extensions `.js`, `.jsdoc`, and
181181
`.jsx` will be processed.
182182
+ `source.excludePattern`: An optional string, interpreted as a regular expression. If present, any
183183
file matching this regular expression will be ignored. By default, this option is set so that files

content/en/about-namepaths.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ MyConstructor~innerMember // note that JSDoc 2 uses a dash
2121
```
2222
{% endexample %}
2323

24-
The example below shows: an _instance_ method named "say," an _inner_ function also named "say," and a _static_ method also named "say." These are three distinct methods that all exist independently of one another.
24+
The example below shows: an _instance_ method named `say`, an _inner_ function also named `say`, and a _static_ method also named `say`. These are three distinct methods that all exist independently of one another.
2525

2626
{% example "Use a documentation tag to describe your code." %}
2727

@@ -58,7 +58,7 @@ Person~say // the inner method named "say."
5858
```
5959
{% endexample %}
6060

61-
You might wonder why there is a syntax to refer to an inner method when that method isn't directly accessible from outside the function it is defined in. While that is true, and thus the "~" syntax is rarely used, it _is_ possible to return a reference to an inner method from another method inside that container, so it is possible that some object elsewhere in your code might borrow an inner method.
61+
You might wonder why there is a syntax to refer to an inner method when that method isn't directly accessible from outside the function it is defined in. While that is true, and thus the `~` syntax is rarely used, it _is_ possible to return a reference to an inner method from another method inside that container, so it is possible that some object elsewhere in your code might borrow an inner method.
6262

6363
Note that if a constructor has an instance member that is also a constructor, you can simply chain the namepaths together to form a longer namepath:
6464

@@ -81,7 +81,7 @@ i.consider();
8181
```
8282
{% endexample %}
8383

84-
In this case, to refer to the method named "consider," you would use the following namepath:
84+
In this case, to refer to the method named `consider`, you would use the following namepath:
8585
`Person#Idea#consider`
8686

8787

@@ -102,7 +102,7 @@ This chaining can be used with any combination of the connecting symbols: `# . ~
102102
```
103103
{% endexample %}
104104

105-
There are some special cases with namepaths: [@module][module-tag] names are prefixed by "module:", [@external][external-tag] names are prefixed by "external:", and [@event][event-tag] names are prefixed by "event:".
105+
There are some special cases with namepaths: [`@module`][module-tag] names are prefixed by `module:`, [`@external`][external-tag] names are prefixed by `external:`, and [`@event`][event-tag] names are prefixed by `event:`.
106106

107107
{% example "Namepaths of objects with special characters in the name." %}
108108

@@ -136,8 +136,8 @@ var chat = {
136136
{% endexample %}
137137

138138
Above is an example of a namespace with "unusual" characters in its member names (the hash character, dashes, even quotes).
139-
To refer to these you just need quote the names: chat."#channel", chat."#channel"."op:announce-motd", and so on.
140-
Internal quotes in names should be escaped with backslashes: chat."#channel"."say-\"hello\"".
139+
To refer to these you just need quote the names: `chat."#channel"`, `chat."#channel"."op:announce-motd"`, and so on.
140+
Internal quotes in names should be escaped with backslashes: `chat."#channel"."say-\"hello\""`.
141141

142142
[event-tag]: tags-event.html
143143
[external-tag]: tags-external.html

content/en/about-plugins.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ An event-handler plugin can stop later plugins from running by setting a `stopPr
6363
on the event object (`e.stopPropagation = true`). A plugin can stop the event from firing by setting
6464
a `preventDefault` property (`e.preventDefault = true`).
6565

66-
#### Event: parseBegin
66+
#### Event: `parseBegin`
6767

6868
The `parseBegin` event is fired before JSDoc starts loading and parsing the source files. Your
6969
plugin can control which files JSDoc will parse by modifying the event's contents.
@@ -74,7 +74,7 @@ The event object contains the following properties:
7474

7575
+ `sourcefiles`: An array of paths to source files that will be parsed.
7676

77-
#### Event: fileBegin
77+
#### Event: `fileBegin`
7878

7979
The `fileBegin` event is fired when the parser is about to parse a file. Your plugin can use this
8080
event to trigger per-file initialization if necessary.
@@ -83,7 +83,7 @@ The event object contains the following properties:
8383

8484
+ `filename`: The name of the file.
8585

86-
#### Event: beforeParse
86+
#### Event: `beforeParse`
8787

8888
The `beforeParse` event is fired before parsing has begun. Plugins can use this method to modify the
8989
source code that will be parsed. For instance, your plugin could add a JSDoc comment, or it could
@@ -118,7 +118,7 @@ exports.handlers = {
118118
```
119119
{% endexample %}
120120

121-
#### Event: jsdocCommentFound
121+
#### Event: `jsdocCommentFound`
122122

123123
The `jsdocCommentFound` event is fired whenever a JSDoc comment is found. The comment may or may not
124124
be associated with any code. You might use this event to modify the contents of a comment before it
@@ -131,7 +131,7 @@ The event object contains the following properties:
131131
+ `lineno`: The line number on which the comment was found.
132132
+ `columnno`: The column number on which the comment was found. Available in JSDoc 3.5.0 and later.
133133

134-
#### Event: symbolFound
134+
#### Event: `symbolFound`
135135

136136
The `symbolFound` event is fired when the parser comes across a symbol in the code that may need to
137137
be documented. For example, the parser fires a `symbolFound` event for each variable, function, and
@@ -153,7 +153,7 @@ properties depending on the symbol.
153153

154154
[node-visitors]: #node-visitors
155155

156-
#### Event: newDoclet
156+
#### Event: `newDoclet`
157157

158158
The `newDoclet` event is the highest-level event. It is fired when a new doclet has been created.
159159
This means that a JSDoc comment or a symbol has been processed, and the actual doclet that will be
@@ -206,7 +206,7 @@ exports.handlers = {
206206

207207
[about-commandline]: about-commandline.html
208208

209-
#### Event: fileComplete
209+
#### Event: `fileComplete`
210210

211211
The `fileComplete` event is fired when the parser has finished parsing a file. Your plugin could use
212212
this event to trigger per-file cleanup.
@@ -216,7 +216,7 @@ The event object contains the following properties:
216216
+ `filename`: The name of the file.
217217
+ `source`: The contents of the file.
218218

219-
#### Event: parseComplete
219+
#### Event: `parseComplete`
220220

221221
The `parseComplete` event is fired after JSDoc has parsed all of the specified source files.
222222

@@ -230,7 +230,7 @@ about the properties that each doclet can contain. Available in JSDoc 3.2.1 and
230230

231231
[newdoclet-event]: #event-newdoclet
232232

233-
#### Event: processingComplete
233+
#### Event: `processingComplete`
234234

235235
The `processingComplete` event is fired after JSDoc updates the parse results to reflect inherited
236236
and borrowed symbols.

content/en/tags-abstract.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ synonyms:
77

88
## Overview
99

10-
The @abstract tag identifies members that must be implemented (or overridden) by objects that
10+
The `@abstract` tag identifies members that must be implemented (or overridden) by objects that
1111
inherit the member.
1212

1313
## Example

content/en/tags-alias.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ related:
1313

1414
## Overview
1515

16-
The @alias tag causes JSDoc to treat all references to a member as if the member had a different
16+
The `@alias` tag causes JSDoc to treat all references to a member as if the member had a different
1717
name. This tag is especially useful if you define a class within an inner function; in this case,
18-
you can use the @alias tag to tell JSDoc how the class is exposed in your app.
18+
you can use the `@alias` tag to tell JSDoc how the class is exposed in your app.
1919

20-
While the @alias tag may sound similar to the @name tag, these tags behave very differently. The
21-
@name tag tells JSDoc to ignore any code associated with the comment. For example, when JSDoc
20+
While the `@alias` tag may sound similar to the `@name` tag, these tags behave very differently. The
21+
`@name` tag tells JSDoc to ignore any code associated with the comment. For example, when JSDoc
2222
processes the following code, it ignores the fact that the comment for `bar` is attached to a
2323
function:
2424

@@ -30,7 +30,7 @@ function:
3030
function foo() {}
3131
```
3232

33-
The @alias tag tells JSDoc to pretend that Member A is actually named Member B. For example, when
33+
The `@alias` tag tells JSDoc to pretend that <var>Member A</var> is actually named <var>Member B</var>. For example, when
3434
JSDoc processes the following code, it recognizes that `foo` is a function, then renames `foo` to
3535
`bar` in the documentation:
3636

@@ -48,12 +48,12 @@ function foo() {}
4848
## Examples
4949

5050
Suppose you are using a class framework that expects you to pass in a constructor function when you
51-
define a class. You can use the @alias tag to tell JSDoc how the class will be exposed in your app.
51+
define a class. You can use the `@alias` tag to tell JSDoc how the class will be exposed in your app.
5252

53-
In the following example, the @alias tag tells JSDoc to treat the anonymous function as if it were
54-
the constructor for the class "trackr.CookieManager". Within the function, JSDoc interprets the
55-
`this` keyword relative to trackr.CookieManager, so the "value" method has the namepath
56-
"trackr.CookieManager#value".
53+
In the following example, the `@alias` tag tells JSDoc to treat the anonymous function as if it were
54+
the constructor for the class `trackr.CookieManager`. Within the function, JSDoc interprets the
55+
`this` keyword relative to `trackr.CookieManager`, so the `value` method has the namepath
56+
`trackr.CookieManager#value`.
5757

5858
{% example "Using @alias with an anonymous constructor function" %}
5959

@@ -74,8 +74,8 @@ Klass('trackr.CookieManager',
7474
```
7575
{% endexample %}
7676

77-
You can also use the @alias tag with members that are created within an immediately invoked function
78-
expression (IIFE). The @alias tag tells JSDoc that these members are exposed outside of the IIFE's
77+
You can also use the `@alias` tag with members that are created within an immediately invoked function
78+
expression (IIFE). The `@alias` tag tells JSDoc that these members are exposed outside of the IIFE's
7979
scope.
8080

8181
{% example "Using @alias for static members of a namespace" %}
@@ -99,8 +99,8 @@ var Apple = {};
9999
```
100100
{% endexample %}
101101

102-
For members that are defined within an object literal, you can use the @alias tag as an alternative
103-
to the [@lends][lends-tag] tag.
102+
For members that are defined within an object literal, you can use the `@alias` tag as an alternative
103+
to the [`@lends`][lends-tag] tag.
104104

105105
{% example "Using @alias for an object literal" %}
106106

content/en/tags-author.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ related:
1313

1414
## Overview
1515

16-
The @author tag identifies the author of an item. In JSDoc 3.2 and later, if the author's name is
16+
The `@author` tag identifies the author of an item. In JSDoc 3.2 and later, if the author's name is
1717
followed by an email address enclosed in angle brackets, the default template will convert the email
1818
address to a `mailto:` link.
1919

content/en/tags-borrows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ description: This object uses something from another object.
1010

1111
## Overview
1212

13-
The @borrows tag allows you to add documentation for another symbol to your documentation.
13+
The `@borrows` tag allows you to add documentation for another symbol to your documentation.
1414

1515
This tag would be useful if you had more than one way to reference a function, but you didn't want
1616
to duplicate the same documentation in two places.
1717

1818

1919
## Examples
2020

21-
In this example there exists documentation for the "trstr" function, but "util.trim" is just a
21+
In this example there exists documentation for the `trstr` function, but `util.trim` is just a
2222
reference to that same function by a different name.
2323

2424
{% example "Duplicate the documentation for trstr as util.trim" %}

content/en/tags-callback.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ related:
1313

1414
## Overview
1515

16-
The @callback tag provides information about a callback function that can be passed to other
16+
The `@callback` tag provides information about a callback function that can be passed to other
1717
functions, including the callback's parameters and return value. You can include any of the tags
18-
that you can provide for a @method.
18+
that you can provide for a `@method`.
1919

2020
Once you define a callback, you can use it in the same way as a custom type defined with the
21-
@typedef tag. In particular, you can use the callback's name as a type name. This allows you to
21+
`@typedef` tag. In particular, you can use the callback's name as a type name. This allows you to
2222
indicate that a function parameter should contain a certain type of callback.
2323

2424
If you want a callback to be displayed with the type definitions for a specific class, you can give

content/en/tags-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ related:
1414

1515
## Overview
1616

17-
The @class tag marks a function as being a constructor, meant to be called with the new
17+
The `@class` tag marks a function as being a constructor, meant to be called with the `new`
1818
keyword to return an instance.
1919

2020

content/en/tags-classdesc.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ related:
1313

1414
## Overview
1515

16-
The @classdesc tag is used to provide a description for a class, separate from the constructor
17-
function's description. Use the @classdesc tag in combination with the [@class (or @constructor)
16+
The `@classdesc` tag is used to provide a description for a class, separate from the constructor
17+
function's description. Use the `@classdesc` tag in combination with the [`@class` (or `@constructor`)
1818
tag][class-tag].
1919

20-
The functionality of the @classdesc tag in JSDoc 3 duplicates that of the @class in previous
21-
versions. As of version 3, the syntax and functionality of the @class tag now exactly matches the
22-
@constructor tag, and the @classdesc tag more explicitly communicates its purpose: to document a
20+
The functionality of the `@classdesc` tag in JSDoc 3 duplicates that of the `@class` in previous
21+
versions. As of version 3, the syntax and functionality of the `@class` tag now exactly matches the
22+
`@constructor` tag, and the `@classdesc` tag more explicitly communicates its purpose: to document a
2323
class's description.
2424

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

content/en/tags-constant.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ related:
1515

1616
## Overview
1717

18-
The @constant tag is used to mark the documentation as belonging to a symbol that is a constant.
18+
The `@constant` tag is used to mark the documentation as belonging to a symbol that is a constant.
1919

2020

2121
## Examples
2222

2323
In this example we are documenting a string constant. Note that although the code is using the
2424
`const` keyword, this is not required by JSDoc. If your JavaScript host environment doesn't yet
25-
support constant declarations, the @const documentation can just as effectively be used on `var`
25+
support constant declarations, the `@const` documentation can just as effectively be used on `var`
2626
declarations.
2727

2828
{% example "A string constant representing the color red" %}
@@ -39,6 +39,6 @@ var ONE = 1;
3939
```
4040
{% endexample %}
4141

42-
Note that the example provides the type in a @type tag. This is optional. Also the optional
43-
@default tag is used here too, this will automatically add whatever the assigned value is (for
44-
example 'FF0000') to the documentation.
42+
Note that the example provides the type in a `@type` tag. This is optional. Also the optional
43+
`@default` tag is used here too, this will automatically add whatever the assigned value is (for
44+
example `'FF0000'`) to the documentation.

content/en/tags-copyright.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ related:
1212

1313
## Overview
1414

15-
The @copyright tag is used to document copyright information in a file overview comment. Use this
16-
tag in combination with the [@file tag][file-tag].
15+
The `@copyright` tag is used to document copyright information in a file overview comment. Use this
16+
tag in combination with the [`@file` tag][file-tag].
1717

1818
[file-tag]: tags-file.html
1919

content/en/tags-default.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ synonyms:
1212

1313
## Overview
1414

15-
The @default tag allows you to document the assigned value of a symbol. You can supply this tag with
15+
The `@default` tag allows you to document the assigned value of a symbol. You can supply this tag with
1616
a value yourself or you can allow JSDoc to automatically document the value from the source code --
1717
only possible when the documented symbol is being assigned a single, simple value that is either: a
1818
string, a number, a boolean or null.
@@ -21,7 +21,7 @@ string, a number, a boolean or null.
2121
## Examples
2222

2323
In this example a constant is documented. The value of the constant is `0xff0000`. By adding the
24-
@default tag this value is automatically added to the documentation.
24+
`@default` tag this value is automatically added to the documentation.
2525

2626
{% example "Document the number value of a constant" %}
2727

content/en/tags-deprecated.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ description: Document that this is no longer the preferred way.
1010

1111
## Overview
1212

13-
The @deprecated tag marks a symbol in your code as being deprecated.
13+
The `@deprecated` tag marks a symbol in your code as being deprecated.
1414

1515
## Examples
1616

17-
You can use the @deprecated tag by itself, or include some text that describes more about the
17+
You can use the `@deprecated` tag by itself, or include some text that describes more about the
1818
deprecation.
1919

2020
{% example "Document that the old function has been deprecated since version 2.0" %}

content/en/tags-description.md

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

1616
## Overview
1717

18-
The @description tag allows you to provide a general description of the symbol you are documenting.
18+
The `@description` tag allows you to provide a general description of the symbol you are documenting.
1919
The description may include HTML markup. It may also include Markdown formatting if the
2020
[Markdown plugin][markdown-plugin] is enabled.
2121

@@ -25,7 +25,7 @@ The description may include HTML markup. It may also include Markdown formatting
2525
## Examples
2626

2727
If you describe a symbol at the very beginning of a JSDoc comment, before using any block tags, you
28-
may omit the @description tag.
28+
may omit the `@description` tag.
2929

3030
{% example "Describing a symbol without the @description tag" %}
3131

@@ -42,7 +42,7 @@ function add(a, b) {
4242
```
4343
{% endexample %}
4444

45-
By using the @description tag, you can place the description anywhere in the JSDoc comment.
45+
By using the `@description` tag, you can place the description anywhere in the JSDoc comment.
4646

4747
{% example "Describing a symbol with the @description tag" %}
4848

@@ -59,4 +59,4 @@ function add(a, b) {
5959
```
6060
{% endexample %}
6161

62-
If there's both a description at the beginning of a JSDoc comment and a description provided with the @description tag, the description specified with the @description will override the description at the beginning of the comment.
62+
If there's both a description at the beginning of a JSDoc comment and a description provided with the `@description` tag, the description specified with the `@description` will override the description at the beginning of the comment.

0 commit comments

Comments
 (0)