@cparra/apexdocs 1.13.8 → 1.16.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/.gitattributes +2 -0
- package/.github/workflows/ci.yml +29 -0
- package/README.md +57 -35
- package/docs/.nojekyll +0 -0
- package/docs/404.html +24 -24
- package/docs/README.md +49 -9
- package/docs/Sample-Classes/SampleClass.md +2 -5
- package/docs/Sample-Classes/SampleClass2.md +2 -5
- package/docs/Sample-Classes/SampleClassMultipleAuthorsAndDates.md +120 -0
- package/docs/Sample-Interfaces/SampleInterface.md +1 -4
- package/docs/_config.yml +40 -40
- package/docs/assets/css/style.css +319 -319
- package/docs/index.html +21 -0
- package/docs/index.md +21 -0
- package/docs/single-file/Sample-Classes/SampleClass.md +115 -115
- package/examples/apex/SampleClassMultipleAuthorsAndDates.cls +100 -0
- package/examples/config/config.json +4 -0
- package/examples/dir1/SampleClass.cls +96 -0
- package/examples/dir2/SampleInterface.cls +17 -0
- package/lib/Command/Generate.d.ts +1 -1
- package/lib/Command/Generate.js +34 -19
- package/lib/Command/__test__/Generte.test.js +3 -3
- package/lib/MarkdownDocsProcessor.js +13 -6
- package/lib/MetadataProcessor.d.ts +3 -0
- package/lib/MetadataProcessor.js +15 -0
- package/lib/Parser/ClassParser.js +30 -19
- package/lib/Parser/MethodParser.js +2 -2
- package/lib/Parser/__test__/ClassParser.test.js +8 -2
- package/lib/Parser/__test__/MethodParser.test.js +3 -2
- package/lib/application/Apexdocs.js +6 -3
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.js +8 -3
- package/lib/index.js.map +1 -1
- package/lib/model/ApexModel.d.ts +9 -6
- package/lib/model/ApexModel.js +18 -10
- package/lib/model/file.js +1 -0
- package/lib/model/file.js.map +1 -1
- package/lib/model/manifest-diff.d.ts +24 -2
- package/lib/model/manifest-diff.js +61 -2
- package/lib/model/manifest-diff.js.map +1 -1
- package/lib/model/markdown-file.d.ts +2 -0
- package/lib/model/markdown-file.js +29 -0
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +7 -0
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +24 -0
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -0
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js +34 -12
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/index.js +13 -6
- package/lib/model/markdown-generation-util/index.js.map +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js +5 -5
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.js +5 -11
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
- package/lib/model/markdown-home-file.d.ts +1 -0
- package/lib/model/markdown-home-file.js +7 -5
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +10 -3
- package/lib/model/markdown-type-file.js +70 -10
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/types-repository.d.ts +8 -0
- package/lib/model/types-repository.js +22 -0
- package/lib/model/types-repository.js.map +1 -0
- package/lib/service/apex-file-reader.d.ts +1 -1
- package/lib/service/apex-file-reader.js +5 -4
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/file-system.js +1 -0
- package/lib/service/file-system.js.map +1 -1
- package/lib/service/file-writer.js +1 -0
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/manifest-factory.js +1 -0
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/parser.js +1 -0
- package/lib/service/parser.js.map +1 -1
- package/lib/service/walkers/class-walker.js +1 -0
- package/lib/service/walkers/class-walker.js.map +1 -1
- package/lib/service/walkers/enum-walker.js +1 -0
- package/lib/service/walkers/enum-walker.js.map +1 -1
- package/lib/service/walkers/interface-walker.js +1 -0
- package/lib/service/walkers/interface-walker.js.map +1 -1
- package/lib/service/walkers/walker-factory.js +1 -0
- package/lib/service/walkers/walker-factory.js.map +1 -1
- package/lib/service/walkers/walker.js +1 -0
- package/lib/service/walkers/walker.js.map +1 -1
- package/lib/settings.d.ts +3 -0
- package/lib/settings.js +7 -0
- package/lib/settings.js.map +1 -1
- package/lib/transpiler/file-container.js +1 -0
- package/lib/transpiler/file-container.js.map +1 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +9 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +1 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/markdown-transpiler-base.js +1 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
- package/lib/util/logger.js +1 -0
- package/lib/util/logger.js.map +1 -1
- package/package.json +6 -2
- package/src/Command/Generate.ts +40 -19
- package/src/Command/__test__/Generte.test.ts +3 -3
- package/src/MarkdownDocsProcessor.ts +15 -6
- package/src/MetadataProcessor.ts +16 -0
- package/src/Model/ApexModel.ts +21 -10
- package/src/Parser/ClassParser.ts +37 -19
- package/src/Parser/MethodParser.ts +2 -2
- package/src/Parser/__test__/ClassParser.test.ts +8 -2
- package/src/Parser/__test__/MethodParser.test.ts +3 -2
- package/src/Settings.ts +10 -0
- package/src/cli/generate.ts +9 -2
package/docs/index.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Document</title>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
7
|
+
<meta name="description" content="Description">
|
|
8
|
+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
9
|
+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app"></div>
|
|
13
|
+
<script>
|
|
14
|
+
window.$docsify = {
|
|
15
|
+
name: '',
|
|
16
|
+
repo: ''
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/docs/index.md
CHANGED
|
@@ -11,12 +11,26 @@ This is a class description.
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
### [SampleClass](/Sample-Classes/SampleClass.md)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
This is a class description.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
14
21
|
### [SampleClass2](/Sample-Classes/SampleClass2.md)
|
|
15
22
|
|
|
16
23
|
|
|
17
24
|
This is a class description.
|
|
18
25
|
|
|
19
26
|
|
|
27
|
+
|
|
28
|
+
### [SampleClassMultipleAuthorsAndDates](/Sample-Classes/SampleClassMultipleAuthorsAndDates.md)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
This is a class description.
|
|
32
|
+
|
|
33
|
+
|
|
20
34
|
## Sample Interfaces
|
|
21
35
|
|
|
22
36
|
### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
@@ -25,3 +39,10 @@ This is a class description.
|
|
|
25
39
|
This is an interface description.
|
|
26
40
|
|
|
27
41
|
|
|
42
|
+
|
|
43
|
+
### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
This is an interface description.
|
|
47
|
+
|
|
48
|
+
|
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: default
|
|
3
|
-
---
|
|
4
|
-
# SampleClass class
|
|
5
|
-
|
|
6
|
-
`NamespaceAccessible`
|
|
7
|
-
|
|
8
|
-
This is a class description.
|
|
9
|
-
|
|
10
|
-
## Related
|
|
11
|
-
|
|
12
|
-
SampleInterface
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
SampleClass2
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
## Constructors
|
|
19
|
-
### `SampleClass()`
|
|
20
|
-
|
|
21
|
-
`NamespaceAccessible`
|
|
22
|
-
|
|
23
|
-
Constructs a SampleClass without any arguments.
|
|
24
|
-
#### Example
|
|
25
|
-
```
|
|
26
|
-
<pre>
|
|
27
|
-
SampleClass sampleInstance = new SampleClass();
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### `SampleClass(String argument)`
|
|
31
|
-
|
|
32
|
-
`NamespaceAccessible`
|
|
33
|
-
|
|
34
|
-
Constructs a SampleClass with an argument.
|
|
35
|
-
#### Parameters
|
|
36
|
-
|
|
37
|
-
| Param | Description |
|
|
38
|
-
| ----- | ----------- |
|
|
39
|
-
|`argument` | Some argument. Of type String. |
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
## Properties
|
|
43
|
-
|
|
44
|
-
### `AnotherProp` → `Decimal`
|
|
45
|
-
|
|
46
|
-
`NamespaceAccessible`
|
|
47
|
-
|
|
48
|
-
This is a Decimal property.
|
|
49
|
-
|
|
50
|
-
### `MyProp` → `String`
|
|
51
|
-
|
|
52
|
-
`NamespaceAccessible`
|
|
53
|
-
|
|
54
|
-
This is a String property.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
## Methods
|
|
58
|
-
### `call()` → `void`
|
|
59
|
-
|
|
60
|
-
`NamespaceAccessible`
|
|
61
|
-
|
|
62
|
-
Calls the method. This methods allows you to call it.
|
|
63
|
-
|
|
64
|
-
### `testMethod(String argument)` → `String`
|
|
65
|
-
|
|
66
|
-
`NamespaceAccessible`
|
|
67
|
-
|
|
68
|
-
Executes commands based on the passed in argument.
|
|
69
|
-
|
|
70
|
-
#### Example
|
|
71
|
-
```
|
|
72
|
-
<pre>
|
|
73
|
-
String result = SampleClass.testMethod();
|
|
74
|
-
System.debug(result);
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
## Inner Classes
|
|
79
|
-
|
|
80
|
-
### SampleClass.AnotherInnerClass class
|
|
81
|
-
|
|
82
|
-
Inner class belonging to SampleClass.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
#### Properties
|
|
86
|
-
|
|
87
|
-
##### `InnerProp` → `public`
|
|
88
|
-
|
|
89
|
-
Description of the inner property.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
#### Methods
|
|
93
|
-
##### `innerMethod()` → `void`
|
|
94
|
-
|
|
95
|
-
Executes from the inner class.
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
### SampleClass.InnerClass class
|
|
99
|
-
|
|
100
|
-
Inner class belonging to SampleClass.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
#### Properties
|
|
104
|
-
|
|
105
|
-
##### `InnerProp` → `public`
|
|
106
|
-
|
|
107
|
-
Description of the inner property.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
#### Methods
|
|
111
|
-
##### `innerMethod()` → `void`
|
|
112
|
-
|
|
113
|
-
Executes from the inner class.
|
|
114
|
-
|
|
115
|
-
---
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
---
|
|
4
|
+
# SampleClass class
|
|
5
|
+
|
|
6
|
+
`NamespaceAccessible`
|
|
7
|
+
|
|
8
|
+
This is a class description.
|
|
9
|
+
|
|
10
|
+
## Related
|
|
11
|
+
|
|
12
|
+
SampleInterface
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
SampleClass2
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
## Constructors
|
|
19
|
+
### `SampleClass()`
|
|
20
|
+
|
|
21
|
+
`NamespaceAccessible`
|
|
22
|
+
|
|
23
|
+
Constructs a SampleClass without any arguments.
|
|
24
|
+
#### Example
|
|
25
|
+
```
|
|
26
|
+
<pre>
|
|
27
|
+
SampleClass sampleInstance = new SampleClass();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### `SampleClass(String argument)`
|
|
31
|
+
|
|
32
|
+
`NamespaceAccessible`
|
|
33
|
+
|
|
34
|
+
Constructs a SampleClass with an argument.
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
| Param | Description |
|
|
38
|
+
| ----- | ----------- |
|
|
39
|
+
|`argument` | Some argument. Of type String. |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
## Properties
|
|
43
|
+
|
|
44
|
+
### `AnotherProp` → `Decimal`
|
|
45
|
+
|
|
46
|
+
`NamespaceAccessible`
|
|
47
|
+
|
|
48
|
+
This is a Decimal property.
|
|
49
|
+
|
|
50
|
+
### `MyProp` → `String`
|
|
51
|
+
|
|
52
|
+
`NamespaceAccessible`
|
|
53
|
+
|
|
54
|
+
This is a String property.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
## Methods
|
|
58
|
+
### `call()` → `void`
|
|
59
|
+
|
|
60
|
+
`NamespaceAccessible`
|
|
61
|
+
|
|
62
|
+
Calls the method. This methods allows you to call it.
|
|
63
|
+
|
|
64
|
+
### `testMethod(String argument)` → `String`
|
|
65
|
+
|
|
66
|
+
`NamespaceAccessible`
|
|
67
|
+
|
|
68
|
+
Executes commands based on the passed in argument.
|
|
69
|
+
|
|
70
|
+
#### Example
|
|
71
|
+
```
|
|
72
|
+
<pre>
|
|
73
|
+
String result = SampleClass.testMethod();
|
|
74
|
+
System.debug(result);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
## Inner Classes
|
|
79
|
+
|
|
80
|
+
### SampleClass.AnotherInnerClass class
|
|
81
|
+
|
|
82
|
+
Inner class belonging to SampleClass.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
#### Properties
|
|
86
|
+
|
|
87
|
+
##### `InnerProp` → `public`
|
|
88
|
+
|
|
89
|
+
Description of the inner property.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
#### Methods
|
|
93
|
+
##### `innerMethod()` → `void`
|
|
94
|
+
|
|
95
|
+
Executes from the inner class.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
### SampleClass.InnerClass class
|
|
99
|
+
|
|
100
|
+
Inner class belonging to SampleClass.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
#### Properties
|
|
104
|
+
|
|
105
|
+
##### `InnerProp` → `public`
|
|
106
|
+
|
|
107
|
+
Description of the inner property.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
#### Methods
|
|
111
|
+
##### `innerMethod()` → `void`
|
|
112
|
+
|
|
113
|
+
Executes from the inner class.
|
|
114
|
+
|
|
115
|
+
---
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description This is a class description.
|
|
3
|
+
* @author John Doe
|
|
4
|
+
* @date 1/1/2021
|
|
5
|
+
* @author Jane Doe
|
|
6
|
+
* @date 2/2/2022
|
|
7
|
+
* @group Sample Classes
|
|
8
|
+
* @see SampleInterface
|
|
9
|
+
* @see SampleClass2
|
|
10
|
+
*/
|
|
11
|
+
@NamespaceAccessible
|
|
12
|
+
public with sharing class SampleClassMultipleAuthorsAndDates {
|
|
13
|
+
/**
|
|
14
|
+
* @description Constructs a SampleClassMultipleAuthorsAndDates without any arguments.
|
|
15
|
+
* @example
|
|
16
|
+
* <pre>
|
|
17
|
+
* SampleClassMultipleAuthorsAndDates sampleInstance = new SampleClassMultipleAuthorsAndDates();
|
|
18
|
+
*/
|
|
19
|
+
@NamespaceAccessible
|
|
20
|
+
public SampleClassMultipleAuthorsAndDates() {
|
|
21
|
+
System.debug('Constructor');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @description Constructs a SampleClassMultipleAuthorsAndDates with an argument.
|
|
26
|
+
* @param argument Some argument
|
|
27
|
+
*/
|
|
28
|
+
public SampleClassMultipleAuthorsAndDates(String argument) {
|
|
29
|
+
System.debug('Constructor');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @description Executes commands based on the passed in argument.
|
|
34
|
+
* @example
|
|
35
|
+
* <pre>
|
|
36
|
+
* String result = SampleClassMultipleAuthorsAndDates.testMethod();
|
|
37
|
+
* System.debug(result);
|
|
38
|
+
*/
|
|
39
|
+
@NamespaceAccessible
|
|
40
|
+
public static String testMethod(String argument) {
|
|
41
|
+
System.debug('Execute');
|
|
42
|
+
return '';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @description Calls the method.
|
|
48
|
+
* This methods allows you to call it.
|
|
49
|
+
*/
|
|
50
|
+
public static void call() {
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @description This is a String property.
|
|
55
|
+
*/
|
|
56
|
+
public String MyProp { get; set; }
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @description This is a Decimal property.
|
|
60
|
+
*/
|
|
61
|
+
public Decimal AnotherProp { get; private set; }
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @description Inner class belonging to SampleClassMultipleAuthorsAndDates.
|
|
65
|
+
*/
|
|
66
|
+
public class InnerClass {
|
|
67
|
+
/**
|
|
68
|
+
* @description Description of the inner property.
|
|
69
|
+
*/
|
|
70
|
+
public InnerProp {
|
|
71
|
+
get; set;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @description Executes from the inner class.
|
|
76
|
+
*/
|
|
77
|
+
public void innerMethod() {
|
|
78
|
+
System.debug('Executing inner method.');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @description Inner class belonging to SampleClassMultipleAuthorsAndDates.
|
|
84
|
+
*/
|
|
85
|
+
public class AnotherInnerClass {
|
|
86
|
+
/**
|
|
87
|
+
* @description Description of the inner property.
|
|
88
|
+
*/
|
|
89
|
+
public InnerProp {
|
|
90
|
+
get; set;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @description Executes from the inner class.
|
|
95
|
+
*/
|
|
96
|
+
public void innerMethod() {
|
|
97
|
+
System.debug('Executing inner method.');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description This is a class description.
|
|
3
|
+
* @group Sample Classes
|
|
4
|
+
* @see SampleInterface
|
|
5
|
+
* @see SampleClass2
|
|
6
|
+
*/
|
|
7
|
+
@NamespaceAccessible
|
|
8
|
+
public with sharing class SampleClass {
|
|
9
|
+
/**
|
|
10
|
+
* @description Constructs a SampleClass without any arguments.
|
|
11
|
+
* @example
|
|
12
|
+
* <pre>
|
|
13
|
+
* SampleClass sampleInstance = new SampleClass();
|
|
14
|
+
*/
|
|
15
|
+
@NamespaceAccessible
|
|
16
|
+
public SampleClass() {
|
|
17
|
+
System.debug('Constructor');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @description Constructs a SampleClass with an argument.
|
|
22
|
+
* @param argument Some argument
|
|
23
|
+
*/
|
|
24
|
+
public SampleClass(String argument) {
|
|
25
|
+
System.debug('Constructor');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @description Executes commands based on the passed in argument.
|
|
30
|
+
* @example
|
|
31
|
+
* <pre>
|
|
32
|
+
* String result = SampleClass.testMethod();
|
|
33
|
+
* System.debug(result);
|
|
34
|
+
*/
|
|
35
|
+
@NamespaceAccessible
|
|
36
|
+
public static String testMethod(String argument) {
|
|
37
|
+
System.debug('Execute');
|
|
38
|
+
return '';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @description Calls the method.
|
|
44
|
+
* This methods allows you to call it.
|
|
45
|
+
*/
|
|
46
|
+
public static void call() {
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @description This is a String property.
|
|
51
|
+
*/
|
|
52
|
+
public String MyProp { get; set; }
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @description This is a Decimal property.
|
|
56
|
+
*/
|
|
57
|
+
public Decimal AnotherProp { get; private set; }
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @description Inner class belonging to SampleClass.
|
|
61
|
+
*/
|
|
62
|
+
public class InnerClass {
|
|
63
|
+
/**
|
|
64
|
+
* @description Description of the inner property.
|
|
65
|
+
*/
|
|
66
|
+
public InnerProp {
|
|
67
|
+
get; set;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @description Executes from the inner class.
|
|
72
|
+
*/
|
|
73
|
+
public void innerMethod() {
|
|
74
|
+
System.debug('Executing inner method.');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @description Inner class belonging to SampleClass.
|
|
80
|
+
*/
|
|
81
|
+
public class AnotherInnerClass {
|
|
82
|
+
/**
|
|
83
|
+
* @description Description of the inner property.
|
|
84
|
+
*/
|
|
85
|
+
public InnerProp {
|
|
86
|
+
get; set;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @description Executes from the inner class.
|
|
91
|
+
*/
|
|
92
|
+
public void innerMethod() {
|
|
93
|
+
System.debug('Executing inner method.');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description This is an interface description.
|
|
3
|
+
* @group Sample Interfaces
|
|
4
|
+
* @see SampleClass
|
|
5
|
+
*/
|
|
6
|
+
public interface SampleInterface {
|
|
7
|
+
/**
|
|
8
|
+
* @description Executes the command.
|
|
9
|
+
*/
|
|
10
|
+
void execute();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description Returns a value based on the executed command.
|
|
14
|
+
* @return Empty value
|
|
15
|
+
*/
|
|
16
|
+
String getValue();
|
|
17
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import ClassModel from '../Model/ClassModel';
|
|
2
|
-
export declare function generate(
|
|
2
|
+
export declare function generate(sourceDirectories: (string | number)[], recursive?: boolean, scope?: string[], outputDir?: string, targetGenerator?: string, configPath?: string, group?: boolean, indexOnly?: boolean): ClassModel[];
|
package/lib/Command/Generate.js
CHANGED
|
@@ -7,9 +7,11 @@ const FileParser_1 = require("../Parser/FileParser");
|
|
|
7
7
|
const DocsifyDocsProcessor_1 = require("../DocsifyDocsProcessor");
|
|
8
8
|
const JekyllDocsProcessor_1 = require("../JekyllDocsProcessor");
|
|
9
9
|
const AsJsDocsProcessor_1 = require("../AsJsDocsProcessor");
|
|
10
|
-
|
|
10
|
+
const MetadataProcessor_1 = require("../MetadataProcessor");
|
|
11
|
+
function generate(sourceDirectories, recursive = true, scope = ['global', 'public', 'namespaceaccessible'], outputDir = 'docs', targetGenerator = 'jekyll', configPath, group, indexOnly = false) {
|
|
11
12
|
Settings_1.default.getInstance().setScope(scope);
|
|
12
13
|
Settings_1.default.getInstance().setOutputDir(outputDir);
|
|
14
|
+
Settings_1.default.getInstance().setIndexOnly(indexOnly);
|
|
13
15
|
if (targetGenerator === 'jekyll') {
|
|
14
16
|
Settings_1.default.getInstance().setDocsProcessor(new JekyllDocsProcessor_1.default());
|
|
15
17
|
}
|
|
@@ -26,29 +28,42 @@ function generate(sourceDirectory, recursive = true, scope = ['global', 'public'
|
|
|
26
28
|
Settings_1.default.getInstance().setConfigPath(configPath);
|
|
27
29
|
}
|
|
28
30
|
// TODO: Assert data validation to avoid exposing 'fs' and 'path' errors to callers.
|
|
29
|
-
const classes = getClassesFromDirectory(
|
|
31
|
+
const classes = getClassesFromDirectory(sourceDirectories, recursive);
|
|
30
32
|
// tslint:disable-next-line:no-console
|
|
31
33
|
console.log(`Processed ${classes.length} files`);
|
|
32
34
|
return classes;
|
|
33
35
|
}
|
|
34
36
|
exports.generate = generate;
|
|
35
|
-
function getClassesFromDirectory(
|
|
37
|
+
function getClassesFromDirectory(sourceDirectories, recursive) {
|
|
36
38
|
let classes = [];
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
for (const currentDirectory of sourceDirectories) {
|
|
40
|
+
const sourceDirectory = currentDirectory;
|
|
41
|
+
const directoryContents = fs.readdirSync(sourceDirectory);
|
|
42
|
+
directoryContents.forEach(currentFile => {
|
|
43
|
+
const currentPath = path.join(sourceDirectory, currentFile);
|
|
44
|
+
if (recursive && fs.statSync(currentPath).isDirectory()) {
|
|
45
|
+
classes = classes.concat(getClassesFromDirectory([currentPath], recursive));
|
|
46
|
+
}
|
|
47
|
+
if (!currentFile.endsWith('.cls')) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const rawFile = fs.readFileSync(currentPath);
|
|
51
|
+
const response = new FileParser_1.default().parseFileContents(rawFile.toString());
|
|
52
|
+
const rawFileMetadata = fs.existsSync(currentPath + '-meta.xml') ? fs.readFileSync(currentPath + '-meta.xml') : null;
|
|
53
|
+
if (!response) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (rawFileMetadata != null && response != null) {
|
|
57
|
+
let metadataGenericParams = MetadataProcessor_1.default.process(rawFileMetadata.toString());
|
|
58
|
+
metadataGenericParams.forEach((value, key) => {
|
|
59
|
+
response.setGeneric(key, value);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (!response) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
classes.push(response);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
53
68
|
return classes;
|
|
54
69
|
}
|
|
@@ -10,18 +10,18 @@ beforeEach(() => {
|
|
|
10
10
|
});
|
|
11
11
|
it('returns an empty list when there are no files', () => {
|
|
12
12
|
fs.readdirSync.mockReturnValue([]);
|
|
13
|
-
const classes = Generate_1.generate('src');
|
|
13
|
+
const classes = Generate_1.generate(['src']);
|
|
14
14
|
expect(classes.length).toBe(0);
|
|
15
15
|
});
|
|
16
16
|
it('returns an empty list when there are no files ending in .cls', () => {
|
|
17
17
|
fs.readdirSync.mockReturnValue(['file.xml', 'README.md']);
|
|
18
|
-
const classes = Generate_1.generate('src', false);
|
|
18
|
+
const classes = Generate_1.generate(['src'], false);
|
|
19
19
|
expect(classes.length).toBe(0);
|
|
20
20
|
});
|
|
21
21
|
it('returns parsed files when there are .cls files', () => {
|
|
22
22
|
fs.readdirSync.mockReturnValue(['TestClass.cls', 'README.md']);
|
|
23
23
|
fs.readFileSync.mockReturnValue('Raw class data');
|
|
24
|
-
Generate_1.generate('src', false);
|
|
24
|
+
Generate_1.generate(['src'], false);
|
|
25
25
|
expect(FileParser_1.default).toHaveBeenCalledTimes(1);
|
|
26
26
|
const mockFileParserInstance = FileParser_1.default.mock.instances[0];
|
|
27
27
|
const mockParseFileContents = mockFileParserInstance.parseFileContents;
|
|
@@ -65,6 +65,9 @@ class MarkdownDocsProcessor extends DocsProcessor_1.default {
|
|
|
65
65
|
var _a, _b;
|
|
66
66
|
const generator = new MarkdownHelper_1.default(this.classes);
|
|
67
67
|
this.onBeforeClassFileCreated(generator);
|
|
68
|
+
if (Settings_1.default.getInstance().getIndexOnly() === true) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
68
71
|
const startingHeadingLevel = ((_b = (_a = Configuration_1.default.getConfig()) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.startingHeadingLevel) || 1;
|
|
69
72
|
this.generateDocsForClass(generator, classModel, startingHeadingLevel);
|
|
70
73
|
if (!fs.existsSync(outputDir)) {
|
|
@@ -102,13 +105,17 @@ class MarkdownDocsProcessor extends DocsProcessor_1.default {
|
|
|
102
105
|
generator.addText(classModel.getDescription());
|
|
103
106
|
generator.addBlankLine();
|
|
104
107
|
}
|
|
105
|
-
if ((
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
if ((_g = (_f = Configuration_1.default.getConfig()) === null || _f === void 0 ? void 0 : _f.content) === null || _g === void 0 ? void 0 : _g.includeAuthor) {
|
|
109
|
+
for (const currentAuthor of classModel.getAuthors()) {
|
|
110
|
+
generator.addBlankLine();
|
|
111
|
+
generator.addText(`**Author:** ${currentAuthor}`);
|
|
112
|
+
}
|
|
108
113
|
}
|
|
109
|
-
if ((
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
if ((_j = (_h = Configuration_1.default.getConfig()) === null || _h === void 0 ? void 0 : _h.content) === null || _j === void 0 ? void 0 : _j.includeDate) {
|
|
115
|
+
for (const currentDate of classModel.getDates()) {
|
|
116
|
+
generator.addBlankLine();
|
|
117
|
+
generator.addText(`**Date:** ${currentDate}`);
|
|
118
|
+
}
|
|
112
119
|
}
|
|
113
120
|
if (classModel.getSeeList().length !== 0) {
|
|
114
121
|
generator.addTitle('Related', level + 1);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
4
|
+
class MetadataProcessor {
|
|
5
|
+
static process(input) {
|
|
6
|
+
let map = new Map();
|
|
7
|
+
let xml = new fast_xml_parser_1.XMLParser().parse(input);
|
|
8
|
+
let apiVersion = xml.ApexClass.apiVersion;
|
|
9
|
+
map.set('apiVersion', apiVersion !== null ? apiVersion : '');
|
|
10
|
+
let status = xml.ApexClass.status;
|
|
11
|
+
map.set('status', status !== null ? status : '');
|
|
12
|
+
return map;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = MetadataProcessor;
|