@cparra/apexdocs 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -112
- package/docs/{Misc → API}/SampleClassWithoutModifier.md +0 -0
- package/docs/README.md +1 -1
- package/lib/cli/generate.js +6 -0
- package/lib/cli/generate.js.map +1 -1
- package/lib/settings.d.ts +2 -0
- package/lib/settings.js +3 -0
- package/lib/settings.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js +2 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/package.json +2 -2
- package/src/cli/generate.ts +6 -0
- package/src/settings.ts +5 -0
- package/src/transpiler/markdown/class-file-generatorHelper.ts +2 -1
- package/docs/.nojekyll +0 -0
- package/docs/Misc/SampleClass.md +0 -168
package/README.md
CHANGED
|
@@ -68,6 +68,11 @@ public class MyClass {
|
|
|
68
68
|
}
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
* Apex docs blocks can now all be in a single line
|
|
72
|
+
* Support for grouping blocks of related code within a class
|
|
73
|
+
* Support for HTML tags
|
|
74
|
+
* And more!
|
|
75
|
+
|
|
71
76
|
### Demo
|
|
72
77
|
|
|
73
78
|
ApexDocs currently supports generating markdown files for Jekyll and Docsify sites.
|
|
@@ -81,13 +86,13 @@ ApexDocs currently supports generating markdown files for Jekyll and Docsify sit
|
|
|
81
86
|
|
|
82
87
|
Demo
|
|
83
88
|
|
|
84
|
-
- [Docsify](https://cesarparra.github.io/apexdocs
|
|
89
|
+
- [Docsify](https://cesarparra.github.io/apexdocs/)
|
|
85
90
|
|
|
86
91
|
### [Jekyll](https://jekyllrb.com/)
|
|
87
92
|
|
|
88
93
|
Demo
|
|
89
94
|
|
|
90
|
-
- [Jekyll](https://cesarparra.github.io/apexdocs/)
|
|
95
|
+
- [Jekyll](https://cesarparra.github.io/apexdocs-docsify-example/)
|
|
91
96
|
|
|
92
97
|
## Installation
|
|
93
98
|
|
|
@@ -109,117 +114,33 @@ apexdocs-generate
|
|
|
109
114
|
|
|
110
115
|
The CLI supports the following parameters:
|
|
111
116
|
|
|
112
|
-
| Parameter
|
|
113
|
-
|
|
114
|
-
| --sourceDir
|
|
115
|
-
| --targetDir
|
|
116
|
-
| --recursive
|
|
117
|
-
| --scope
|
|
118
|
-
| --targetGenerator
|
|
119
|
-
| --indexOnly
|
|
120
|
-
| --
|
|
121
|
-
| --group | -o | (Only versions 1.X) Define whether the generated files should be grouped by the @group tag on the top level classes. | `true` | No |
|
|
122
|
-
|
|
123
|
-
#### Configuration File
|
|
124
|
-
|
|
125
|
-
You can optionally specify the path to a configuration JSON file through the `--configPath` parameter. This let's you
|
|
126
|
-
have some additional control over the content outputs.
|
|
127
|
-
|
|
128
|
-
The configuration file allows you to specify the following:
|
|
129
|
-
|
|
130
|
-
_Note_: Everything in the configuration file is optional. When something is not specified, the default will be used.
|
|
131
|
-
|
|
132
|
-
`root` (String)
|
|
133
|
-
|
|
134
|
-
Default: None
|
|
135
|
-
|
|
136
|
-
Allows you to specify the root directory for where the files are being generated. This can be helpful when embedding the
|
|
137
|
-
generated docs into an existing site so that the links are generated correctly.
|
|
138
|
-
|
|
139
|
-
`defaultGroupName`
|
|
140
|
-
|
|
141
|
-
Default: Miscellaneous
|
|
142
|
-
|
|
143
|
-
Defines the `@group` name to be used when a file does not specify it.
|
|
144
|
-
|
|
145
|
-
`sourceLanguage`
|
|
146
|
-
|
|
147
|
-
Default: None
|
|
148
|
-
|
|
149
|
-
Defines the name of the language that will be used when generating `@example` blocks. Use this when you are interested
|
|
150
|
-
in using syntax highlighting for your project.
|
|
151
|
-
|
|
152
|
-
Even though the source code material for which documentation is generated is always `Apex`, generally you will be able
|
|
153
|
-
to use a syntax highlighter that recognizes `java` source code, so set this value to `java` in those cases.
|
|
154
|
-
|
|
155
|
-
`home` (Object)
|
|
156
|
-
|
|
157
|
-
Gives you control over the home page.
|
|
158
|
-
|
|
159
|
-
`home.header` (String)
|
|
160
|
-
|
|
161
|
-
Default: None
|
|
162
|
-
|
|
163
|
-
Allows you to embed custom content into your home page by using the `header` property to point to the file which
|
|
164
|
-
contents will be added to the top of the generated home page.
|
|
165
|
-
|
|
166
|
-
Specify the path with the content that you want to embed.
|
|
167
|
-
|
|
168
|
-
`content` (Object)
|
|
117
|
+
| Parameter | Alias | Description | Default | Required |
|
|
118
|
+
|--------------------|-------|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------|----------|
|
|
119
|
+
| --sourceDir | -s | The directory location which contains your apex .cls classes. | N/A | Yes |
|
|
120
|
+
| --targetDir | -t | The directory location where documentation will be generated to. | `docs` | No |
|
|
121
|
+
| --recursive | -r | Whether .cls classes will be searched for recursively in the directory provided. | `true` | No |
|
|
122
|
+
| --scope | -p | A list of scopes to document. Values should be separated by a space, e.g --scope public private | `global namespaceaccessible public` | No |
|
|
123
|
+
| --targetGenerator | -g | Define the static file generator for which the documents will be created. Currently supports jekyll and docsify. | `jekyll` | No |
|
|
124
|
+
| --indexOnly | N/A | Defines whether only the index file should be generated. | `false` | No |
|
|
125
|
+
| --defaultGroupName | N/A | Defines the `@group` name to be used when a file does not specify it. | `Miscellaneous` | No |
|
|
169
126
|
|
|
170
|
-
Gives you control over the content pages.
|
|
171
|
-
|
|
172
|
-
`content.includeAuthor` (Boolean)
|
|
173
|
-
|
|
174
|
-
Default: false
|
|
175
|
-
|
|
176
|
-
Whether the `@author` tag should be used to add the file's author to the page.
|
|
177
|
-
|
|
178
|
-
`content.includeDate` (Boolean)
|
|
179
|
-
|
|
180
|
-
Default: false
|
|
181
|
-
|
|
182
|
-
Whether the `@date` tag should be used to add the file's date to the page.
|
|
183
|
-
|
|
184
|
-
`content.startingHeadingLevel` (Number)
|
|
185
|
-
|
|
186
|
-
Default: 1
|
|
187
|
-
|
|
188
|
-
The starting H tag level for the document. Each title will use this as the starting point to docGenerator the
|
|
189
|
-
appropriate `<h#>` tag. For example, if set to 1, the class' file name at the top of the file will use an `<h1>` tag,
|
|
190
|
-
the `Properties` title will be `<h2>`, each property name will be an `<h3>`, etc.
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
{
|
|
194
|
-
"root": "root-directory",
|
|
195
|
-
"defaultGrouName": "api",
|
|
196
|
-
"sourceLanguage": "java",
|
|
197
|
-
"home": {
|
|
198
|
-
"header": "./examples/includes/header.md"
|
|
199
|
-
},
|
|
200
|
-
"content": {
|
|
201
|
-
"startingHeadingLevel": 1,
|
|
202
|
-
"includeAuthor": true,
|
|
203
|
-
"includeDate": true
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
```
|
|
207
127
|
|
|
208
128
|
### Importing to your project
|
|
209
129
|
|
|
210
|
-
If you are just interested in the Apex parsing capabilities, you can use the
|
|
130
|
+
If you are just interested in the Apex parsing capabilities, you can use the
|
|
131
|
+
standalone [Apex Reflection Library](https://www.npmjs.com/package/@cparra/apex-reflection)
|
|
211
132
|
which is what gets used by this library behind the scenes to generate the documentation files.
|
|
212
133
|
|
|
213
134
|
## Documentation Format
|
|
214
135
|
|
|
215
|
-
ApexDocs picks up blocks of comments throughout your `.cls` files. The block must begin with `/**` and
|
|
216
|
-
multiple lines, ending with `*/`.
|
|
136
|
+
ApexDocs picks up blocks of comments throughout your `.cls` files. The block must begin with `/**` and end with `*/`.
|
|
217
137
|
|
|
218
138
|
### Documenting Classes
|
|
219
139
|
|
|
220
140
|
The following tags are supported on the class level:
|
|
221
141
|
|
|
222
|
-
**Note** Any custom generated tag is also supported. Custom tags can be added with at symbol (`@`) followed by the name
|
|
142
|
+
**Note** Any custom generated tag is also supported. Custom tags can be added with at symbol (`@`) followed by the name
|
|
143
|
+
of the tag. For example `@custom-tag`
|
|
223
144
|
|
|
224
145
|
| Tag | Description |
|
|
225
146
|
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------|
|
|
@@ -300,7 +221,8 @@ The following tags are supported on the method level:
|
|
|
300
221
|
* @example
|
|
301
222
|
* Object result = SampleClass.call('exampleAction');
|
|
302
223
|
*/
|
|
303
|
-
public static Object call(String action) {
|
|
224
|
+
public static Object call(String action) {
|
|
225
|
+
}
|
|
304
226
|
```
|
|
305
227
|
|
|
306
228
|
### Grouping Declarations Within A Class
|
|
@@ -310,6 +232,7 @@ groups of constants that should be grouped together because they share a common
|
|
|
310
232
|
of constants representing the possible values for different picklists.)
|
|
311
233
|
|
|
312
234
|
You can group things together within a class by using the following syntax:
|
|
235
|
+
|
|
313
236
|
```apex
|
|
314
237
|
// @start-group Group Name or Description
|
|
315
238
|
public static final String CONSTANT_FOO = 'Foo';
|
|
@@ -320,16 +243,19 @@ public static final String CONSTANT_BAR = 'Bar';
|
|
|
320
243
|
Groups of members are displayed together under their own subsection after its name or description.
|
|
321
244
|
|
|
322
245
|
Some notes about grouping:
|
|
246
|
+
|
|
323
247
|
* This is only supported on classes, NOT enums and interfaces
|
|
324
248
|
* Supports
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
* BUT only members of the same type are grouped together. For example,
|
|
330
|
-
if you have a group that contains properties and methods the properties will be grouped together under Properties ->
|
|
249
|
+
* Properties
|
|
250
|
+
* Fields (variables and constants)
|
|
251
|
+
* Constructors
|
|
252
|
+
* Methods
|
|
253
|
+
* BUT only members of the same type are grouped together. For example,
|
|
254
|
+
if you have a group that contains properties and methods the properties will be grouped together under Properties ->
|
|
255
|
+
Group Name, and the methods will be grouped together under Methods -> Group Name
|
|
331
256
|
* Does not support inner types (inner classes, interfaces, and enums)
|
|
332
|
-
* It is necessary to use `// @end-group` whenever a group has been started, otherwise a parsing error will be raised for
|
|
257
|
+
* It is necessary to use `// @end-group` whenever a group has been started, otherwise a parsing error will be raised for
|
|
258
|
+
that file.
|
|
333
259
|
|
|
334
260
|
### Inline linking
|
|
335
261
|
|
|
@@ -349,7 +275,7 @@ Apexdocs recognizes 2 different syntax when linking files:
|
|
|
349
275
|
* @param param1 An <<ExampleClass>> instance. Can also do {@link ExampleClass}
|
|
350
276
|
* @return The result of the operation.
|
|
351
277
|
*/
|
|
352
|
-
public static Object class(ExampleClass param1) {
|
|
278
|
+
public static Object class (ExampleClass param1) {
|
|
353
279
|
```
|
|
354
280
|
|
|
355
281
|
---
|
|
@@ -358,10 +284,13 @@ Email addresses can also be inlined linked by using the `{@email EMAIL_ADDRESS}`
|
|
|
358
284
|
|
|
359
285
|
### HTML support
|
|
360
286
|
|
|
361
|
-
For the most part all HTML is sanitized. But there are some tags are allowed to have for the possibility of better
|
|
362
|
-
|
|
287
|
+
For the most part all HTML is sanitized. But there are some tags are allowed to have for the possibility of better
|
|
288
|
+
styling long text.
|
|
289
|
+
|
|
290
|
+
- Allowed tags are: `br`, `p`, `ul`, and `li`
|
|
363
291
|
|
|
364
292
|
Example
|
|
293
|
+
|
|
365
294
|
```apex
|
|
366
295
|
/**
|
|
367
296
|
* @description <p>This is a paragraph</p>
|
|
@@ -371,9 +300,15 @@ Example
|
|
|
371
300
|
* <li>This is another list item</li>
|
|
372
301
|
* </ul>
|
|
373
302
|
*/
|
|
374
|
-
class MyClass {
|
|
303
|
+
class MyClass {
|
|
304
|
+
}
|
|
375
305
|
```
|
|
376
306
|
|
|
377
307
|
## Typescript
|
|
378
308
|
|
|
379
309
|
ApexDocs provides all necessary type definitions.
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## 1.X
|
|
314
|
+
Looking for documentation for version 1.X? Please refer to its [branch](https://github.com/cesarParra/apexdocs/tree/1.x)
|
|
File without changes
|
package/docs/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Uses a block style apex doc
|
|
|
11
11
|
This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md) But this [ClassThatDoesNotExist](ClassThatDoesNotExist) does not exist. You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
12
12
|
## Miscellaneous
|
|
13
13
|
|
|
14
|
-
### [SampleClassWithoutModifier](/
|
|
14
|
+
### [SampleClassWithoutModifier](/API/SampleClassWithoutModifier.md)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
## Sample Interfaces
|
package/lib/cli/generate.js
CHANGED
|
@@ -42,6 +42,11 @@ const argv = yargs.options({
|
|
|
42
42
|
default: false,
|
|
43
43
|
describe: 'Defines whether only the index file should be generated.',
|
|
44
44
|
},
|
|
45
|
+
defaultGroupName: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
default: 'Miscellaneous',
|
|
48
|
+
describe: 'Defines the @group name to be used when a file does not specify it.',
|
|
49
|
+
},
|
|
45
50
|
}).argv;
|
|
46
51
|
settings_1.Settings.build({
|
|
47
52
|
sourceDirectory: argv.sourceDir,
|
|
@@ -50,6 +55,7 @@ settings_1.Settings.build({
|
|
|
50
55
|
outputDir: argv.targetDir,
|
|
51
56
|
targetGenerator: argv.targetGenerator,
|
|
52
57
|
indexOnly: argv.indexOnly,
|
|
58
|
+
defaultGroupName: argv.defaultGroupName,
|
|
53
59
|
});
|
|
54
60
|
Apexdocs_1.Apexdocs.generate();
|
|
55
61
|
//# sourceMappingURL=generate.js.map
|
package/lib/cli/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAyD;AACzD,sDAAmD;AAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,kFAAkF;KAC7F;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,QAAQ,EACN,sHAAsH;YACtH,0HAA0H;KAC7H;IACD,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC9B,QAAQ,EACN,mHAAmH;KACtH;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,2DAA2D;KACtE;CACF,CAAC,CAAC,IAAI,CAAC;AAER,mBAAQ,CAAC,KAAK,CAAC;IACb,eAAe,EAAE,IAAI,CAAC,SAAS;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,eAAe,EAAE,IAAI,CAAC,eAAmC;IACzD,SAAS,EAAE,IAAI,CAAC,SAAS;
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAyD;AACzD,sDAAmD;AAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,kFAAkF;KAC7F;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,QAAQ,EACN,sHAAsH;YACtH,0HAA0H;KAC7H;IACD,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC9B,QAAQ,EACN,mHAAmH;KACtH;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,2DAA2D;KACtE;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,qEAAqE;KAChF;CACF,CAAC,CAAC,IAAI,CAAC;AAER,mBAAQ,CAAC,KAAK,CAAC;IACb,eAAe,EAAE,IAAI,CAAC,SAAS;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,eAAe,EAAE,IAAI,CAAC,eAAmC;IACzD,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;CACxC,CAAC,CAAC;AAEH,mBAAQ,CAAC,QAAQ,EAAE,CAAC"}
|
package/lib/settings.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface SettingsConfig {
|
|
|
7
7
|
outputDir: string;
|
|
8
8
|
targetGenerator: GeneratorChoices;
|
|
9
9
|
indexOnly: boolean;
|
|
10
|
+
defaultGroupName: string;
|
|
10
11
|
}
|
|
11
12
|
export declare class Settings {
|
|
12
13
|
config: SettingsConfig;
|
|
@@ -20,4 +21,5 @@ export declare class Settings {
|
|
|
20
21
|
get outputDir(): string;
|
|
21
22
|
get typeTranspiler(): ProcessorTypeTranspiler;
|
|
22
23
|
get indexOnly(): boolean;
|
|
24
|
+
getDefaultGroupName(): string;
|
|
23
25
|
}
|
package/lib/settings.js
CHANGED
package/lib/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AACA,4FAAwF;AACxF,iGAAwF;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AACA,4FAAwF;AACxF,iGAAwF;AAcxF,MAAa,QAAQ;IAGnB,YAA2B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C,MAAM,CAAC,KAAK,CAAC,MAAsB;QACxC,QAAQ,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,cAAc;QAChB,QAAQ,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YACnC,KAAK,QAAQ;gBACX,OAAO,IAAI,0CAAmB,EAAE,CAAC;YACnC,KAAK,SAAS;gBACZ,OAAO,IAAI,gCAAoB,EAAE,CAAC;YACpC;gBACE,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAEM,mBAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACtC,CAAC;CACF;AAlDD,4BAkDC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const types_repository_1 = require("../../model/types-repository");
|
|
4
|
+
const settings_1 = require("../../settings");
|
|
4
5
|
class ClassFileGeneratorHelper {
|
|
5
6
|
static getSanitizedGroup(classModel) {
|
|
6
7
|
return this.getClassGroup(classModel).replace(/ /g, '-').replace('.', '');
|
|
@@ -19,7 +20,7 @@ class ClassFileGeneratorHelper {
|
|
|
19
20
|
static getClassGroup(classModel) {
|
|
20
21
|
var _a, _b;
|
|
21
22
|
const groupAnnotation = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'group');
|
|
22
|
-
return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b :
|
|
23
|
+
return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b : settings_1.Settings.getInstance().getDefaultGroupName();
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
exports.default = ClassFileGeneratorHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;
|
|
1
|
+
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAC/D,6CAA0C;AAE1C,MAAqB,wBAAwB;IACpC,MAAM,CAAC,iBAAiB,CAAC,UAAgB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAgB;QACxC,OAAO,IAAI,UAAU,CAAC,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,MAAM,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,MAAM,IAAI,GAAG,kCAAe,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,EAAE;YACT,qFAAqF;YACrF,OAAO,IAAI,QAAQ,KAAK,QAAQ,GAAG,CAAC;SACrC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,UAAgB;;QAC3C,MAAM,eAAe,SAAG,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;QAC7G,aAAO,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAAC;IAC/E,CAAC;CACF;AAvBD,2CAuBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cparra/apexdocs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apex",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"postversion": "git push && git push --tags",
|
|
25
25
|
"docs:init": "docsify init docs",
|
|
26
26
|
"docs:serve": "docsify serve docs",
|
|
27
|
-
"execute:example": "node lib/cli/generate.js -s examples/force-app -t docs --scope global public private -g docsify",
|
|
27
|
+
"execute:example": "node lib/cli/generate.js -s examples/force-app -t docs --scope global public private -g docsify --defaultGroupName API",
|
|
28
28
|
"execute:example:index:only": "node lib/cli/generate.js -s examples/force-app -t docs --scope global public private -g docsify --indexOnly"
|
|
29
29
|
},
|
|
30
30
|
"author": "Cesar Parra",
|
package/src/cli/generate.ts
CHANGED
|
@@ -44,6 +44,11 @@ const argv = yargs.options({
|
|
|
44
44
|
default: false,
|
|
45
45
|
describe: 'Defines whether only the index file should be generated.',
|
|
46
46
|
},
|
|
47
|
+
defaultGroupName: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
default: 'Miscellaneous',
|
|
50
|
+
describe: 'Defines the @group name to be used when a file does not specify it.',
|
|
51
|
+
},
|
|
47
52
|
}).argv;
|
|
48
53
|
|
|
49
54
|
Settings.build({
|
|
@@ -53,6 +58,7 @@ Settings.build({
|
|
|
53
58
|
outputDir: argv.targetDir,
|
|
54
59
|
targetGenerator: argv.targetGenerator as GeneratorChoices,
|
|
55
60
|
indexOnly: argv.indexOnly,
|
|
61
|
+
defaultGroupName: argv.defaultGroupName,
|
|
56
62
|
});
|
|
57
63
|
|
|
58
64
|
Apexdocs.generate();
|
package/src/settings.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface SettingsConfig {
|
|
|
11
11
|
outputDir: string;
|
|
12
12
|
targetGenerator: GeneratorChoices;
|
|
13
13
|
indexOnly: boolean;
|
|
14
|
+
defaultGroupName: string;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export class Settings {
|
|
@@ -59,4 +60,8 @@ export class Settings {
|
|
|
59
60
|
get indexOnly(): boolean {
|
|
60
61
|
return this.config.indexOnly;
|
|
61
62
|
}
|
|
63
|
+
|
|
64
|
+
public getDefaultGroupName(): string {
|
|
65
|
+
return this.config.defaultGroupName;
|
|
66
|
+
}
|
|
62
67
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Type } from '@cparra/apex-reflection';
|
|
2
2
|
import { TypesRepository } from '../../model/types-repository';
|
|
3
|
+
import { Settings } from '../../settings';
|
|
3
4
|
|
|
4
5
|
export default class ClassFileGeneratorHelper {
|
|
5
6
|
public static getSanitizedGroup(classModel: Type) {
|
|
@@ -22,6 +23,6 @@ export default class ClassFileGeneratorHelper {
|
|
|
22
23
|
|
|
23
24
|
private static getClassGroup(classModel: Type): string {
|
|
24
25
|
const groupAnnotation = classModel.docComment?.annotations.find((annotation) => annotation.name === 'group');
|
|
25
|
-
return groupAnnotation?.body ??
|
|
26
|
+
return groupAnnotation?.body ?? Settings.getInstance().getDefaultGroupName();
|
|
26
27
|
}
|
|
27
28
|
}
|
package/docs/.nojekyll
DELETED
|
File without changes
|
package/docs/Misc/SampleClass.md
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# SampleClass
|
|
2
|
-
|
|
3
|
-
`NAMESPACEACCESSIBLE`
|
|
4
|
-
|
|
5
|
-
`APIVERSION: 54`
|
|
6
|
-
|
|
7
|
-
`STATUS: ACTIVE`
|
|
8
|
-
|
|
9
|
-
Something
|
|
10
|
-
|
|
11
|
-
## Constructors
|
|
12
|
-
### My Super Group
|
|
13
|
-
##### `SampleClass()`
|
|
14
|
-
|
|
15
|
-
`NAMESPACEACCESSIBLE`
|
|
16
|
-
|
|
17
|
-
Constructs a SampleClass without any arguments. This relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
18
|
-
|
|
19
|
-
###### Throws
|
|
20
|
-
|Exception|Description|
|
|
21
|
-
|---|---|
|
|
22
|
-
|`ExcName`|some exception|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
**CustomAnnotation** A Custom method annotation
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
**See** [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
29
|
-
|
|
30
|
-
###### Example
|
|
31
|
-
```apex
|
|
32
|
-
// Example
|
|
33
|
-
SampleClass sampleInstance = new SampleClass();
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
### Other
|
|
38
|
-
##### `SampleClass(String argument1, String argument2)`
|
|
39
|
-
|
|
40
|
-
Constructs a SampleClass with an argument.
|
|
41
|
-
|
|
42
|
-
###### Parameters
|
|
43
|
-
|Param|Description|
|
|
44
|
-
|---|---|
|
|
45
|
-
|`argument1`|Argument1 definition|
|
|
46
|
-
|`argument2`|Argument2 definition|
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
## Fields
|
|
50
|
-
### Common Constants
|
|
51
|
-
|
|
52
|
-
* `ANOTHER_CONSTANT` → `String`
|
|
53
|
-
* `A_CONSTANT` → `String` [`NAMESPACEACCESSIBLE` ] - This is a constant.
|
|
54
|
-
---
|
|
55
|
-
### Other variables
|
|
56
|
-
|
|
57
|
-
* `someVariable` → `String`
|
|
58
|
-
---
|
|
59
|
-
## Properties
|
|
60
|
-
|
|
61
|
-
### `AnotherProp` → `Decimal`
|
|
62
|
-
|
|
63
|
-
`AURAENABLED`
|
|
64
|
-
|
|
65
|
-
This is a Decimal property.
|
|
66
|
-
|
|
67
|
-
### `MyProp` → `String`
|
|
68
|
-
|
|
69
|
-
`AURAENABLED`
|
|
70
|
-
`DEPRECATED`
|
|
71
|
-
|
|
72
|
-
This is a String property.
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
## Methods
|
|
76
|
-
### `static sampleMethod(String argument1, String argument2)`
|
|
77
|
-
|
|
78
|
-
`NAMESPACEACCESSIBLE`
|
|
79
|
-
|
|
80
|
-
Executes commands based on the passed in argument.
|
|
81
|
-
|
|
82
|
-
#### Parameters
|
|
83
|
-
|Param|Description|
|
|
84
|
-
|---|---|
|
|
85
|
-
|`argument1`|Argument1 to debug|
|
|
86
|
-
|`argument2`|Argument2 to debug|
|
|
87
|
-
|
|
88
|
-
#### Return
|
|
89
|
-
|
|
90
|
-
**Type**
|
|
91
|
-
|
|
92
|
-
String
|
|
93
|
-
|
|
94
|
-
**Description**
|
|
95
|
-
|
|
96
|
-
Empty string
|
|
97
|
-
|
|
98
|
-
#### Example
|
|
99
|
-
```apex
|
|
100
|
-
String result = SampleClass.testMethod();
|
|
101
|
-
System.debug(result);
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### `static anotherSampleMethod(String arg1)`
|
|
105
|
-
|
|
106
|
-
Something here
|
|
107
|
-
|
|
108
|
-
#### Parameters
|
|
109
|
-
|Param|Description|
|
|
110
|
-
|---|---|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
**Arg1** The arg1 description
|
|
114
|
-
|
|
115
|
-
### `static call()`
|
|
116
|
-
|
|
117
|
-
Calls the method. This methods allows you to call it.
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
## Enums
|
|
121
|
-
### InnerEnum
|
|
122
|
-
|
|
123
|
-
`NAMESPACEACCESSIBLE`
|
|
124
|
-
|
|
125
|
-
This is a namespace accessible enum
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
## Classes
|
|
130
|
-
### AnotherInnerClass
|
|
131
|
-
|
|
132
|
-
Inner class belonging to SampleClass.
|
|
133
|
-
|
|
134
|
-
#### Properties
|
|
135
|
-
|
|
136
|
-
##### `InnerProp` → `String`
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Description of the inner property.
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
#### Methods
|
|
143
|
-
##### `innerMethod()`
|
|
144
|
-
|
|
145
|
-
Executes from the inner class.
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
### InnerClass
|
|
150
|
-
|
|
151
|
-
Inner class belonging to SampleClass.
|
|
152
|
-
|
|
153
|
-
#### Properties
|
|
154
|
-
|
|
155
|
-
##### `InnerProp` → `String`
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
Description of the inner property.
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
#### Methods
|
|
162
|
-
##### `innerMethod()`
|
|
163
|
-
|
|
164
|
-
Executes from the inner class.
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
---
|