You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-6Lines changed: 43 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,20 +83,44 @@ To use `doxyjs` with Doxygen you must make few changes to your Doxyfile.
83
83
84
84
## Documenting code
85
85
86
+
### Files
87
+
88
+
It's pretty straightforward:
89
+
90
+
```javascript
91
+
/*!
92
+
* @file FileName.js
93
+
* @brief File description goes here
94
+
*/
95
+
```
96
+
97
+
will produce:
98
+
99
+
```c++
100
+
/*!
101
+
* @file FileName.js
102
+
* @brief File description goes here
103
+
*/
104
+
```
105
+
86
106
### Variables
87
107
88
108
`doxyjs` will use `var` as default variable's type, but you can override it with `type:<YourTypeHere>`.
89
109
90
110
```javascript
91
-
//! type:String This is variable
92
-
var a = 'some string value';
111
+
//! This is variable
112
+
var a =42;
113
+
//! type:String This is string variable
114
+
var b ='some string value';
93
115
```
94
116
95
117
Code above will transform into:
96
118
97
119
```c++
98
120
//! This is variable
99
-
String a;
121
+
var a;
122
+
//! This is string variable
123
+
String b;
100
124
```
101
125
102
126
However, you can omit any type definitions. Then default type `var` will be used.
@@ -106,6 +130,10 @@ However, you can omit any type definitions. Then default type `var` will be used
106
130
Type definition for function arguments done the same way as for variables. Also you're able define functions's return type, however, this is still optional.
107
131
108
132
```javascript
133
+
//! Short function description
134
+
functionfoo(args) {
135
+
}
136
+
109
137
/*!
110
138
* @brief Test Function
111
139
* @param type:Object param1 first parameter
@@ -120,6 +148,11 @@ function global_function_with_args(param1, param2) {
120
148
Resulting pseudo C++:
121
149
122
150
```c++
151
+
/*!
152
+
* @brief Short function description
153
+
*/
154
+
voidfoo(var args);
155
+
123
156
/*!
124
157
*@brief Test Function
125
158
*@param param1 first parameter
@@ -134,16 +167,18 @@ For functions without return value, just omit `@return` comment section:
134
167
```javascript
135
168
/*!
136
169
* @brief Test Function
170
+
* @param type:Date foo parameter description
137
171
*/
138
-
function global_function_without_arg() {
172
+
function global_function_without_arg(var foo) {
139
173
}
140
174
```
141
175
142
176
```c++
143
177
/*!
144
178
* @brief Test Function
179
+
* @param foo parameter description
145
180
*/
146
-
voidglobal_function_without_arg();
181
+
voidglobal_function_without_arg(Date foo);
147
182
```
148
183
149
184
### Classes
@@ -268,7 +303,7 @@ Here some things to notice:
268
303
269
304
Here `Argument` will be used as base class of `Event`.
270
305
271
-
* Classes brief description and constructor's parameters are extracted from next comment:
306
+
* Class'es brief description and constructor's parameters are extracted from next comment:
272
307
273
308
```javascript
274
309
/*!
@@ -281,6 +316,8 @@ Here some things to notice:
281
316
282
317
Here `@brief` is used for class description, and `@param` is used for constructor's parameters documentation.
283
318
319
+
* Docs for class methods done the same way as for global functions.
0 commit comments